> From: Carl Olivier [mailto:[EMAIL PROTECTED]
[...]
> if (!toDel.delete()) {
> Thread.sleep(1000); //try get around file lock/release
> issue? (? Stab in the dark maybe!)
[...]
Heh. Is someone working on Windows here? There's a known issue that
the JVM holds onto file handles until a garbage collection, which
prevents deletion if the file has recently been used. Instead of
sleeping, you may want to hint to the JVM about a garbage collection,
then retry. Not an issue on UNIX as unlink() works with outstanding
file descriptors referencing the file, by design.
This recently cost me half a day of debugging effort.
- Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]