[
https://issues.apache.org/jira/browse/IO-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17728750#comment-17728750
]
Daniel Blum commented on IO-774:
--------------------------------
I tested with 2.12.0 and the issue is still there.
To use the test program, run it and provide a directory name, which does not
have to exist, as it will create it if necessary. It will open a file in that
directory and then call FileUtils.forceDelete on the directory. It will then
print a listing of the directory contents. If forceDelete were working
correctly, it would throw an exception at that point - as it did when you ran
it - but otherwise it will print a listing for a .nfs file.
Your description of using "c:\tmp\test" suggests you ran it on Windows. As
described, this is an issue on Linux using NFS. It probably doesn't occur on
Windows.
> FileUtils.forceDelete may silently not delete directories
> ---------------------------------------------------------
>
> Key: IO-774
> URL: https://issues.apache.org/jira/browse/IO-774
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.11.0
> Environment: I am using CentOS 7 and Java 8.
> Reporter: Daniel Blum
> Priority: Minor
> Attachments: FileUtilsTest.java
>
>
> Using Linux on NFS, if a file is in use and you delete it, the original file
> is in fact deleted but a ".nfs" file will be left in the directory until the
> thread or process using the file releases its handle. This prevents the
> directory containing from being deleted. The upshot is that if forceDelete is
> called on a directory and there is a file anywhere underneath it which
> something has open, some of the tree will not be deleted with no exception
> being thrown.
> I have attached a simple program which demonstrates the issue.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)