OpenOption v. FileAttribute

Salter, Thomas A Thomas.Salter at unisys.com
Wed Jan 20 15:55:00 PST 2010


What's the intended distinction between OpenOption and FileAttribute?   It seems like most functions that take OpenOption also support an overload with FileAttribute, except for Path.newOutputStream.

It almost looks like OpenOption was intended to be for features that only apply to the processing of the file and FileAttribute was to specify permanent characteristics of the file.  StandardOpenOption.sparse would seem to be an exception.

FileChannel.open (and similar functions) explicitly mention state "An implementation may also support additional options." under the OpenOptions, but don't make the same statement for FileAttribute.  Isn't the intention those can be extended also?

Suppose my file system has a way to save the character encoding of a text file (ASCII, EBCDIC, Unicode).  Should setting that be mapped to an OpenOption or a FileAttribute?

Tom Salter



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20100120/64deb4d1/attachment.html 


More information about the nio-discuss mailing list