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:[EMAIL PROTECTED] 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to