commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (IO-209) FileSystemUtils.freeSpaceKb fails to return correct size for a windows mount point
Date Wed, 29 Sep 2010 19:34:33 GMT

     [ https://issues.apache.org/jira/browse/IO-209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Niall Pemberton resolved IO-209.
--------------------------------

         Assignee: Niall Pemberton
    Fix Version/s: 2.0
       Resolution: Fixed

Looks to me like this was done because windows file names that contain things such as spaces
cause the command to fail. Also I guess since whatever directory is passed windows gives the
same free space result.

Anyway I've removed that code that just takes the first two characters of the path and added
quotes around the file name. This resolves the problems with file names and works on Windows
7 for me.

http://svn.apache.org/viewvc?view=revision&revision=1002819

> FileSystemUtils.freeSpaceKb fails to return correct size for a windows mount point
> ----------------------------------------------------------------------------------
>
>                 Key: IO-209
>                 URL: https://issues.apache.org/jira/browse/IO-209
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.4, 2.0, 2.x
>         Environment: Windows XP, Vista, etc
>            Reporter: Aditya Kishore
>            Assignee: Niall Pemberton
>             Fix For: 2.0
>
>         Attachments: IO-209.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> FileSystemUtils.freeSpaceKb fails to return correct result for a NTFS mount point or
junction.
> Suppose I have a NTFS partition mounted at C:\Data\partition1.
> Now assume that the free space on Partition mounted as C: is 1GB and that mounted on
"C:\Data\partition1" is 2GB. A call to FileSystemUtils.freeSpaceKb("C:\Data\partition1") will
return the free space on C: and not on "C:\Data\partition1".
> This is because while running the "dir /-c" with the given path, the code just retains
first 2 chars i.e. for any path under "C:\blah\de\blah", "dir /-c" will be called with "C:"
which will return incorrect result.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message