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'.
 
Back
Top