W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2014

FileSystem API behavior of seek function

From: Kyle Graehl <kgraehl@gmail.com>
Date: Fri, 17 Jan 2014 11:43:17 -0800
Message-ID: <CAEjNKHFG_OLO_=K2HfnKdvC-5ZcWZEocpGJOvkXWDu3KwXEuxQ@mail.gmail.com>
To: public-webapps@w3.org
I am writing to give my feedback on the behavior of the FileWriter seek
function.

From
http://www.w3.org/TR/file-writer-api/#widl-FileWriter-seek-void-long-long-offset,
we see that for FileWriter.seek, "If position > length then set position to
length." (where length is the length of the file)

It would be really nice if seeking past the end of the file would cause
zeros to be written in the byte range [length, position-1], just how POSIX
does it. I have an application that needs to write past the file boundary
and so emulates POSIX behavior in JavaScript user space land, but it is
quite slow and inefficient compared to having it be done by the underlying
system call.

Not matching the behavior of POSIX seek seems like a poor design decision
to me. Was the current behavior chosen for simplicity of implementation?

If the behavior of FileWriter seek were changed to match the POSIX
behavior, how would applications be able to predict which version of the
FileWriter seek implementation were being used?
Received on Saturday, 18 January 2014 22:17:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:21 UTC