commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roun Lee (JIRA)" <j...@apache.org>
Subject [jira] Updated: (IO-217) FileUtils.copyDirectoryToDirectory makes infinite loops
Date Sun, 29 Aug 2010 13:03:53 GMT

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

Roun Lee updated IO-217:
------------------------

    Attachment: FileUtilsPatch.txt

I have same trouble. I think this is a bug of commons-io.

When you try to copying a directory from source to sub-directory of source directory, infinite
loop happens.

ex) FileUtils.copy(new File("test"), new File("test/test"):
will fall into infinite loop.

This is  why the program copy source include the destination directory.

I change the order of make destination directory and list of source directory. (attachment)

This will list the files of source directory and create the subdirectory which is the destination.



> FileUtils.copyDirectoryToDirectory makes infinite loops
> -------------------------------------------------------
>
>                 Key: IO-217
>                 URL: https://issues.apache.org/jira/browse/IO-217
>             Project: Commons IO
>          Issue Type: Bug
>    Affects Versions: 1.4
>         Environment: Windows XP
>            Reporter: tora yamada
>             Fix For: 2.0
>
>         Attachments: FileUtilsPatch.txt
>
>
> When using FileUtils.copyDirectoryToDirectory, infinite loops has occurred.
> -- detail --
> src directory :  D:\a
> dest directory : D:\a
> call : FileUtils.copyDirectoryToDirectory(new File("D:\a"), new File("D:\a"));
> expected result : directory D:\a\a will be created
> actual result      : D:\a\a\a\a.......   was created
> i guess FileUtils.copyDirectoryToDirectory causes of this result.
> ("destDir.mkdir()" is done before "srcDir.listFiles()")
> am i calling wrong method?
> thank you.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message