Recent Java 9 commit (e5b66323ae45) breaks fsync on directory
Robert Muir
rcmuir at gmail.com
Sat May 16 17:42:34 UTC 2015
On Sat, May 16, 2015 at 1:30 PM, Francis Galiegue <fgaliegue at gmail.com> wrote:
> But at the core of the matter I disagree with your basic premise. To
> me, and to 100-epsilon% of users for that matter, it is perfectly
> logical that opening a stream to a directory should fail before you
> even attempt to read().
I'm not sure how important it really is: you will get the error
eventually, that is what counts.
On the other hand, if someone is using a java application and they
"commit" or "save" their stuff and that returns successfully, they
don't expect for a machine crash to leave them with data loss. To
ensure the directory entries really made it, we need to issue an
fsync().
This is seriously the worst API to be "playing games with".
More information about the nio-dev
mailing list