Commons IO
  1. Commons IO
  2. IO-185

FileSystemUtils.freeSpaceWindows blocks

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 2.0
    • Component/s: Utilities
    • Labels:
      None
    • Environment:

      x86 Windows XP 5.1, Sun Microsystems Inc. Java(TM) SE Runtime Environment 1.6.0_10

      Description

      Hi,

      in my Application I have the problem that FileSystemUtils.freeSpaceWindows works properly for hours and then the function call blocks and does not return anymore. Any Ideas? Thanks.

      The stacktrace:
      -------------
      "Thread-16" daemon prio=5 tid=33 RUNNABLE
      java.io.FileInputStream.readBytes(Native Method)
      java.io.FileInputStream.read(Unknown Source)
      java.io.BufferedInputStream.read1(Unknown Source)
      java.io.BufferedInputStream.read(Unknown Source)
      sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
      sun.nio.cs.StreamDecoder.implRead(Unknown Source)
      sun.nio.cs.StreamDecoder.read(Unknown Source)
      java.io.InputStreamReader.read(Unknown Source)
      java.io.BufferedReader.fill(Unknown Source)
      java.io.BufferedReader.readLine(Unknown Source)
      java.io.BufferedReader.readLine(Unknown Source)
      org.apache.commons.io.FileSystemUtils.performCommand(FileSystemUtils.java:413)
      org.apache.commons.io.FileSystemUtils.freeSpaceWindows(FileSystemUtils.java:225)
      org.apache.commons.io.FileSystemUtils.freeSpaceOS(FileSystemUtils.java:194)
      org.apache.commons.io.FileSystemUtils.freeSpaceKb(FileSystemUtils.java:166)
      -------------

      Regards,
      Martin

        Activity

        Hide
        Martin Thelian added a comment -

        Any feedback on this?
        What about spanning a thead around the performCommand call and aborting the process after a timeout?

        Show
        Martin Thelian added a comment - Any feedback on this? What about spanning a thead around the performCommand call and aborting the process after a timeout?
        Hide
        Niall Pemberton added a comment -

        I have added additional methods that take a 'timeout' parameter which do as you suggest:

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

        Show
        Niall Pemberton added a comment - I have added additional methods that take a 'timeout' parameter which do as you suggest: http://svn.apache.org/viewvc?view=revision&revision=1002689

          People

          • Assignee:
            Niall Pemberton
            Reporter:
            Martin Thelian
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development