This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes How to get hte size of the folder[urgent] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to get hte size of the folder[urgent]" Watch "How to get hte size of the folder[urgent]" New topic
Author

How to get hte size of the folder[urgent]

netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
Hi I want to get the size of the folder & also display the size of the sub folders too.Is there any simpler way to do so?I have an idea of adding the files present in the current sub-directory,display it as the size of that directory ,then add it with the size of the parent directory & display that as the size of the parent directory.Please suggest me if u have some better idea,also tell me how to manage the list of directories & sub-directories of a drive,since they exist in large numbers.
Happy middling with java.
Netharam.
Harish Kashyap
Ranch Hand

Joined: Jun 14, 2000
Posts: 118
u r thinking the right way....
don't waste your time searching for short-cuts...
you have to load a directory then list it and sum the size of each file it contains...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get hte size of the folder[urgent]