| Author |
Size of File
|
Fisher Daniel
Ranch Hand
Joined: Sep 14, 2001
Posts: 582
|
|
Dear all, How can I get the size of a folder ? thanks daniel
|
 |
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
|
|
I'm not sure if this is exactly what you're looking for, but I was able to come up with the size of all the files within a directory by using a recursive function, like this: I'm not really sure if there is an easier way to do this or not, but it seems that simply calling the length method on a File object that represents a directory simply returns 0. Therefore, I had to look at each file individually and recurse through any subdirectories. The final result printed the size of all of the files contained within the directory C:\test in bytes. I hope this helps you out. Corey
|
SCJP Tipline, etc.
|
 |
 |
|
|
subject: Size of File
|
|
|