Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get hte size of the folder[urgent]

 
netharam ram
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic