When running the multiple instances of the above class concurrently
1) from different JVM
2) against the same directory
3) with different instance id (so that multiple instances will not operate on the same file)
the line 28 file.renameTo() method returns false, even though when the file name is successfully renamed.
However, when Thread.sleep() method call in line 21 is commented out, the problem does not occur anymore.
Any idea why the return value of file.renameTo method call indicates a failure when in fact it really worked? Could this be a coding issue, JVM issue (
Java 1.3.1), or OS issue (NT 4.0)?
Any insights are greatly appreciated.
Jiang
[ April 02, 2004: Message edited by: Jiang Lin ]