commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-276) "FileUtils#deleteDirectoryOnExit(File)" does not work
Date Thu, 01 Mar 2012 16:39:59 GMT

    [ https://issues.apache.org/jira/browse/IO-276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220146#comment-13220146
] 

Sebb commented on IO-276:
-------------------------

BTW FileUtils#cleanDirectoryOnExit is also a private method
                
> "FileUtils#deleteDirectoryOnExit(File)" does not work
> -----------------------------------------------------
>
>                 Key: IO-276
>                 URL: https://issues.apache.org/jira/browse/IO-276
>             Project: Commons IO
>          Issue Type: Bug
>         Environment: Commons IO 1.4
>            Reporter: nkami
>            Priority: Minor
>         Attachments: IO-276-r1201108-patch.txt
>
>
> I called this method, but the target directory was not deleted.
> The source of this method is as follows.
> ----------
>     private static void deleteDirectoryOnExit(File directory) throws IOException {
>         if (!directory.exists()) {
>             return;
>         }
>         cleanDirectoryOnExit(directory);
>         directory.deleteOnExit();
>     }
> ----------
> In other words, this method calls "java.io.File#deleteOnExit" in order of "grandchildren
-> children -> parent" for files of the target directory hierarchy.
> There is following mention in javadoc of "java.io.File#deleteOnExit".
> ----------
> Files (or directories) are deleted in the reverse order that they are registered.
> ----------
> Therefore, I think the calling order of "java.io.File#deleteOnExit" should be reverse.
> How will be it?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message