possible to get a file size without having to loop through DirectoryInfo?

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I just have a single file and want to know it's size. It seems getting its path,
creating a new DirectoryInfo object, and looping through it for the file I'm
looking for is a bit... roundabout. Is there a more direct way?

Bob
 
* "Bob said:
I just have a single file and want to know it's size. It seems getting its path,
creating a new DirectoryInfo object, and looping through it for the file I'm
looking for is a bit... roundabout. Is there a more direct way?

'FileLen(<file path>)' returns the length of a file in bytes.
Alternatively you can use 'FileInfo.Length'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top