Open
Description
When calling Files.touch(foo)
on a file that already exists, Guava will call java.io.File#createNewFile()
and assume the file already exists if the creation operation fails. But because Java guarantees the existence check and creation are atomic, the existence check lives inside a call to java.io.FileSystem#createFileExclusively
, introducing concurrency penalties that might not be needed.
Instead, Guava should skip file.createNewFile()
when file.exists()
returns true.
Activity