commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Baxter" <>
Subject RE: (COMMONS-IO) Handling of JVM bug #4742723 (race condition in File.mkdirs)
Date Tue, 06 Oct 2009 13:22:48 GMT
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 [] 
Sent: 06 October 2009 11:20
Subject: (COMMONS-IO) Handling of JVM bug #4742723 (race condition in



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



James Baxter

View raw message