Re: directory size

From: Roedy Green (look-on_at_mindprod.com.invalid)
Date: 07/06/04


Date: Tue, 06 Jul 2004 18:19:59 GMT

On Sun, 4 Jul 2004 18:59:56 GMT-5, DaleKing@newsrvr.tce.com (Dale
King) wrote or quoted :

>But be aware that the file size you get in Java is the size of
>the logical contents of the file not the amount of disk space
>taken up. Such a method will tell you that 100 files that only
>contain 1 byte are the same size as 1 file of 100 bytes. In
>reality the amount of disk sace taken is vastly different.

I don't think there is any way in pure Java you can get the overhead
size. You would need some JNI to find out the cluster size, and round
the java sizes up, possibly adding some overhead for the directory
entries.

There are the further complications in W2K of compressed files and
short files stored in the directory itself.

-- 
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Relevant Pages

  • JNI CallVoidMethod (returning a jobject)
    ... I have a C++/JNI program that creates a Java object, ... members and returns the jobject to the calling Java program. ... private Float amount; ... ReturnData class"); ...
    (comp.lang.java)
  • Coding Help
    ... I am in an Into to Java class and this is my last week. ... classes in HTML coding yet, I have had one class in QBasic and am ... and three buttons ("Deposit" to add the amount to the ... balance, "Withdraw" to subtract the amount from the balance, and "Balance" ...
    (comp.lang.java.help)
  • Re: XP Pro.. making space?
    ... You can try limiting the amount ... save a chunk of hard disk space ... When I look to try and tune the system restore feature, ... shutdown option of 'sleep' to 'shutdown' when the start menu was set to ...
    (uk.comp.homebuilt)
  • Re: registry cleaner
    ... The amount of disk space used by left-over registry ... Registry cleaners often claim to speed up your machine by ... removing such entries. ...
    (microsoft.public.windowsxp.general)
  • Re: Limit folder (with subfolders) capacity
    ... nobody, apache, LOCAL SYSTEM or whatever. ... quotas work over system users. ... But each user is assigned their own directory, and he can limit the amount of space used by that directory. ... Both Linux and Windows 2003 Server allow you to limit the amount of disk space used by a single directory. ...
    (comp.lang.php)