You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Stephen Colebourne (JIRA)" <ji...@apache.org> on 2006/06/06 14:34:44 UTC

[jira] Updated: (IO-34) [io] FileSystemUtils returns incorrect free space on Linux

     [ http://issues.apache.org/jira/browse/IO-34?page=all ]

Stephen Colebourne updated IO-34:
---------------------------------

    Bugzilla Id:   (was: 38574)
    Fix Version: 1.2 Final
        Version: 1.1 Final
                     (was: 1.1.0)

> [io] FileSystemUtils returns incorrect free space on Linux
> ----------------------------------------------------------
>
>          Key: IO-34
>          URL: http://issues.apache.org/jira/browse/IO-34
>      Project: Commons IO
>         Type: Bug

>     Versions: 1.1 Final
>  Environment: Operating System: Linux
> Platform: Other
>     Reporter: Niall Gallagher
>      Fix For: 1.2 Final

>
> Re: Commons-IO class FileSystemUtils
> The method freeSpace(String path) returns free disk space in bytes on Windows,
> and returns free disk space in kilobytes (not bytes) on Linux (possibly Unix /
> Mac OS etc. also).  
> The internal method freeSpaceUnix javadoc reads "Find free space on the *nix
> platform using the 'df' command." The value returned by df is read in to a
> variable called bytes and returned. Man pages for df on Linux (Fedora Core 4)
> read "Disk  space  is  shown  in  1K blocks  by  default". So method
> freeSpaceUnix is returning the number of kilobytes free space, not bytes.
> A simple fix could be to add line "bytes = bytes * 1024;" after bytes are read in.
> The javadocs for this class could be improved also. Comment "@return the amount
> of free drive space on the volume" could read "@return the amount of free drive
> space on the volume in bytes".

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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