[jira] Created: (IO-263) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (IO-263) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.

ASF GitHub Bot (Jira)
FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.
---------------------------------------------------------------------------------------

                 Key: IO-263
                 URL: https://issues.apache.org/jira/browse/IO-263
             Project: Commons IO
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 2.0.1
         Environment: Windows XP SP3
            Reporter: Gil Adam


Doing a FileSystemUtils.freeSpaceKb("D:/") where the drive (in this example d:\) is an empty drive (A drive with no non-hidden files on it yet) results in an exception being thrown.

     "Command line returned OS error code '1' for command [cmd.exe, /C, dir /-c "D:\"]

Perhaps it could do a "dir /a /-c" to work in more cases? (Since hidden file "System Volume Information" will usually be available)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (IO-263) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.

ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/IO-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003785#comment-13003785 ]

Gil Adam commented on IO-263:
-----------------------------

Actually, I am doing

FileSystemUtils.freeSpaceKb("d:/", 15000);

> FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.
> ---------------------------------------------------------------------------------------
>
>                 Key: IO-263
>                 URL: https://issues.apache.org/jira/browse/IO-263
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3
>            Reporter: Gil Adam
>
> Doing a FileSystemUtils.freeSpaceKb("D:/") where the drive (in this example d:\) is an empty drive (A drive with no non-hidden files on it yet) results in an exception being thrown.
>      "Command line returned OS error code '1' for command [cmd.exe, /C, dir /-c "D:\"]
> Perhaps it could do a "dir /a /-c" to work in more cases? (Since hidden file "System Volume Information" will usually be available)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IO-263) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/IO-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018067#comment-13018067 ]

Sebb commented on IO-263:
-------------------------

Or, for more efficiency, could just use

bq. DIR /AH /-C x:\

as that only returns the hidden file names (and if that does not work, perhaps try DIR /A /-C)

Note: this method becomes redundant on Java 1.6+, as the java.io.File class finally has getFreeSpace()/getUsableSpace() etc.

> FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.
> ---------------------------------------------------------------------------------------
>
>                 Key: IO-263
>                 URL: https://issues.apache.org/jira/browse/IO-263
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3
>            Reporter: Gil Adam
>
> Doing a FileSystemUtils.freeSpaceKb("D:/") where the drive (in this example d:\) is an empty drive (A drive with no non-hidden files on it yet) results in an exception being thrown.
>      "Command line returned OS error code '1' for command [cmd.exe, /C, dir /-c "D:\"]
> Perhaps it could do a "dir /a /-c" to work in more cases? (Since hidden file "System Volume Information" will usually be available)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Issue Comment Edited] (IO-263) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/IO-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018067#comment-13018067 ]

Sebb edited comment on IO-263 at 4/10/11 11:16 AM:
---------------------------------------------------

Note: this method becomes redundant on Java 1.6+, as the java.io.File class finally has getFreeSpace()/getUsableSpace() etc.

      was (Author: [hidden email]):
    Or, for more efficiency, could just use

bq. DIR /AH /-C x:\

as that only returns the hidden file names (and if that does not work, perhaps try DIR /A /-C)

Note: this method becomes redundant on Java 1.6+, as the java.io.File class finally has getFreeSpace()/getUsableSpace() etc.
 

> FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.
> ---------------------------------------------------------------------------------------
>
>                 Key: IO-263
>                 URL: https://issues.apache.org/jira/browse/IO-263
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3
>            Reporter: Gil Adam
>
> Doing a FileSystemUtils.freeSpaceKb("D:/") where the drive (in this example d:\) is an empty drive (A drive with no non-hidden files on it yet) results in an exception being thrown.
>      "Command line returned OS error code '1' for command [cmd.exe, /C, dir /-c "D:\"]
> Perhaps it could do a "dir /a /-c" to work in more cases? (Since hidden file "System Volume Information" will usually be available)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (IO-263) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Sebb resolved IO-263.
---------------------

       Resolution: Fixed
    Fix Version/s: 2.1

> FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.
> ---------------------------------------------------------------------------------------
>
>                 Key: IO-263
>                 URL: https://issues.apache.org/jira/browse/IO-263
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3
>            Reporter: Gil Adam
>             Fix For: 2.1
>
>
> Doing a FileSystemUtils.freeSpaceKb("D:/") where the drive (in this example d:\) is an empty drive (A drive with no non-hidden files on it yet) results in an exception being thrown.
>      "Command line returned OS error code '1' for command [cmd.exe, /C, dir /-c "D:\"]
> Perhaps it could do a "dir /a /-c" to work in more cases? (Since hidden file "System Volume Information" will usually be available)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (IO-263) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Gary D. Gregory closed IO-263.
------------------------------


Closing, we released version 2.1.
               

> FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.
> ---------------------------------------------------------------------------------------
>
>                 Key: IO-263
>                 URL: https://issues.apache.org/jira/browse/IO-263
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.1
>         Environment: Windows XP SP3
>            Reporter: Gil Adam
>             Fix For: 2.1
>
>
> Doing a FileSystemUtils.freeSpaceKb("D:/") where the drive (in this example d:\) is an empty drive (A drive with no non-hidden files on it yet) results in an exception being thrown.
>      "Command line returned OS error code '1' for command [cmd.exe, /C, dir /-c "D:\"]
> Perhaps it could do a "dir /a /-c" to work in more cases? (Since hidden file "System Volume Information" will usually be available)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira