Do the operations in java.nio.files.Files sync or not?

Alan Bateman Alan.Bateman at oracle.com
Tue Aug 2 02:30:12 PDT 2011


Tim Fox wrote:
> Most of the operations in the Files class (at least) change file meta 
> data, I would therefore expect there to be some way of specifying 
> whether the changes should be synced to disk when invoking those methods.
>
> Whether file meta data is synced or not is already supported when 
> using file channels via the SYNC option in a platform independent way, 
> is there any reason why the same approach hasn't be used in the Files 
> class, or is this just an unfortunate omission?
AFAIK, this has never come up before (java.io.File has never provided 
any guarantees and I don't recall anyone ever commenting on this). It's 
not clear to me that this is even feasible for all operations on all 
platforms and would require some consideration.

-Alan.


More information about the nio-discuss mailing list