Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-209

FileSystemUtils.freeSpaceKb fails to return correct size for a windows mount point

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4, 2.0, 3.x
    • 2.0
    • Utilities
    • None
    • Windows XP, Vista, etc

    Description

      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.

      Attachments

        1. IO-209.patch
          1 kB
          Niall Pemberton

        Activity

          People

            niallp Niall Pemberton
            adityakishore Aditya Kishore
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified