Open
Description
openedon Aug 27, 2021
We tried to switch from our own recursive deleter to Guava's MoreFiles.deleteRecursively
and found many cases where it failed spuriously due to files not existing.
The use case is we have a thread that regularly retries deletions which previously failed, to properly clean up temp files. On some occasions the operating system will tell us that the deletion failed, but then seemingly delete the file in the future. (Yes, this is on Windows, I'm not sure how you guessed.)
A read-through of the Guava code reveals this:
I think if this were instead Files.deleteIfExists(Path)
it would fail a lot less.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment