bug with File.mkdir? (original) (raw)
jjian fan xiaofanhadoop at gmail.com
Mon Jul 30 00:53:46 UTC 2012
- Previous message: Code Review Request For 7185340
- Next message: bug with File.mkdir?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi: Guys, anyone knows there is any bug in Java.io.File.mkdir? In our high cocurrent scala message system, we create directory like ax-0,ax-1,ax-2, but File.mkdir sometimes just create directory ax. The function is like as:
private val fsLock = new ReentrantLock(); private def createLog(topic: String, partition: Int): = { fsLock.lock() try { val d = new File(logDir, topic + "-" + partition)
if(!d.exists()) {
if(d.mkdir())
info("create directory " + d.getAbsolutePath()+" is success")
}
else
{
info("Directory " + topic + "-" + partition + " is existed")
}
}
finally
{
fsLock.unlock()
}
}
Java version is "1.7.0_05-icedtea".
Thanks! Best Regards! Jian Fan
- Previous message: Code Review Request For 7185340
- Next message: bug with File.mkdir?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]