W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2009

Comment on File API's FileData::slice method

From: Darin Fisher <darin@chromium.org>
Date: Thu, 1 Oct 2009 21:31:55 -0700
Message-ID: <bd8f24d20910012131h3900f428u54eb8b483570bbe0@mail.gmail.com>
To: public-webapps@w3.org
FileData::slice appears to be spec'd like so:
FileData slice(in long long offset, in long long length); // throws
FileException

This suggests that it may throw a file exception.  I'm wondering if that is
a requirement?  It seems that the rest of the methods are designed to report
success or failure asynchronously.  I'm wondering why slice is not spec'd
similarly.

I think it would be bad for UAs to implement this exception since it would
require a synchronous stat'ing of the filesystem.  That could hang the
calling thread for a long time (consider network file systems).

It seems like it would be better for the spec to encourage
an asynchronous implementation.  For example, it should be the case that the
FileData object returned by slice may or may not be valid.  The user would
only find out when they try to use the FileData object.

Thoughts?
-Darin
Received on Friday, 2 October 2009 09:54:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:34 GMT