Re: [FileAPI] FileWriter and read-only files

On Mon, Apr 11, 2011 at 12:16 PM, Glenn Maynard <glenn@zewt.org> wrote:
> File objects should have a "readOnly" property, indicating whether write
> permission is granted by the user.  Files returned from <input> elements
> should, by default, set it.  Constructing a FileWriter using a File with its
> readOnly property set should throw an exception.

Are you thinking of FileEntry?  File objects are always immutable, and
there's currently no way to get from a File to a FileWriter.

Having an immutable flag on a FileEntry would make sense, but as
there's currently no API to get a FileWriter outside of the FileSystem
[which has no immutable files], there's no rush to put it in--it can
wait for an API expansion that would let you get such a thing.

> Later, it would be good to also have an attribute on <input> to allow
> opening files for write.  For example, <input type=file file=write> to ask
> for write permission (setting readOnly if only read permission was granted,
> eg. with an "open read-only" checkbox), and <input type=file file=create> to
> also ask the browser to show a "Save As" dialog instead of an "Open" dialog.

We discussed this a while back, and people generally preferred
something like FileSaver instead of markup.

	Eric

Received on Monday, 11 April 2011 20:22:51 UTC