[
https://issues.apache.org/jira/browse/IO-217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903966#action_12903966
]
Roun Lee edited comment on IO-217 at 8/29/10 9:04 AM:
------------------------------------------------------
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.
was (Author: sunradiant):
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.