Looking at the methods on FileUtils, it seems prudent to call forceMkdir before calling moveFileToDirectory, which gives two opportunities for the directory hierarchy to be created...
James Baxter -----Original Message----- From: James Baxter [mailto:[email protected]] Sent: 06 October 2009 11:20 To: [email protected] Subject: (COMMONS-IO) Handling of JVM bug #4742723 (race condition in File.mkdirs) Reference: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4742723 I note the source for FileUtils in commons-io 1.4 is only calling File.mkdirs once (in particular line 1847 in moveFileToDirectory). Should this maybe be called twice to reduce the incidence of the given JVM bug? I see there is a FileTransferException thrown subsequently if the mkdirs failed for some reason. I could catch this and attempt a second call, but I'm wondering... is this check performed, and this exception thrown, consistently throughout commons-io? (i.e. would my handling be a good strategy?) Regards, James Baxter
