commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject RE: FileSystemUtils
Date Tue, 22 Nov 2005 22:04:38 GMT
The maximum value for a long is 92,233,720,368,547,758,07l (that's roughly
92 quintillion I believe).

One gigabyte = 1,073,741,824 bytes.  

So, you could potentially represent 8,589,934,592 gigabytes using a long.
Is my math off here?

-----Original Message-----
From: Marcelo Nery dos Santos [] 
Sent: Tuesday, November 22, 2005 3:26 PM
Subject: FileSystemUtils


After studying the Jakarta Commons IO API, I found a great method that
allows me to delete some native code from my system, it is the:

static long FileSystemUtils.freeSpace(String path)

However, as it return type is long, I am in trouble to represent
values greater than 2GB. Is it possible to add another method into
this class? I would suggest something like:

static double getApproximateFreeSpace(String path)

Thus, if a general (possibly high) approximate value is needed, this
method could be used. In situations where an exact value is needed,
typically, when we are running low in space, the original 'static long
freeSpace(String path)' would fit.

I think this comment is also valid in other areas of the IO package.
However, it is more critical when dealing with file system comprising
several gigabytes of free space. By the javadoc, it is not clear what
value is returned if a free space larger than 2GB if available.

Thanks for this great package.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message