Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10019 make symlinks production-ready
  3. HADOOP-9060

isSymlink returns false for link to non-existing file

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Kubuntu 12.10 commons-io 2.4

    Description

      This problem showed when trying to use FileUtils.sizeOfDirectory() of a directory that contained a symlink to a file that did not exist. I got the exception:

      java.lang.IllegalArgumentException: /tmp/test/link does not exist
      at org.apache.commons.io.FileUtils.sizeOf(FileUtils.java:2413)
      at org.apache.commons.io.FileUtils.sizeOfDirectory(FileUtils.java:2479)

      And /tmp/test/link is here linking to a file that do not exist.

      The trace comes from a unit test that looks like:

      assertTrue(FileUtils.sizeOfDirectory(new File("/tmp/test/")) > 0);

      I would expect that either isSymlink() reported true even though the link is to a file that do not exist or sizeOfDirectory() should not bail out when encountering non-existing files.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              daniel_b Daniel Bengtsson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: