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

Infinite loop on FileUtils.copyDirectory when the destination directory is within the source directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.3.2
    • 1.4
    • Utilities
    • None
    • Win XP

    Description

      When you attempt to copy a directory and the destination directory is inside the source directory an inifinite loop occurs in the copyDirectory causing Commons-IO to create a folder w/o stopping until its reaches OS limitation.

      This code will recreate the bug:

      FileUtils.copyDirectory(new File("C:\\temp\\test-io\\a
      ."), new File("C:\\temp\\test-io\\a
      ." + File.separator + new Date().getTime()));

      Make sure C:\temp\test-io\a exists

      Attachments

        1. fix_recursion_bug.patch
          0.7 kB
          Mark Bryan Yu

        Activity

          People

            niallp Niall Pemberton
            vafada Mark Bryan Yu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: