commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
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 [mailto:marcelo.nery@gmail.com] 
Sent: Tuesday, November 22, 2005 3:26 PM
To: commons-dev@jakarta.apache.org
Subject: FileSystemUtils

Hi,

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.

Marcelo

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message