Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DeviceStorageAPI getEditable not implemented?

23 views
Skip to first unread message

Jan Jongboom

unread,
Mar 18, 2013, 12:12:32 PM3/18/13
to
When I'm calling getEditable on the DeviceStorageAPI I'm presented with an object that has the following keys:

slice, name, type, size, mozSlice, lastModifiedDate, mozFullPath. Oh and instanceof File is true which kinda gives it away :-)

This is a File object rather than a FileHandle, which it should be according to the documentation (https://wiki.mozilla.org/WebAPI/DeviceStorageAPI). Is this a bug or am I missing something?

Here's some code:

var req = this.storage.getEditable(filename);
req.onsuccess = function(e) {
var fileHandle = e.target.result;
alert(fileHandle instanceof File); // true
alert(fileHandle instanceof FileHandle); // false
};

Doug Turner

unread,
Mar 18, 2013, 12:31:57 PM3/18/13
to Jan Jongboom, jva...@mozilla.com
We never got around to implementing getEditable.

Adding Jan who had some passing interesting in doing the work. (btw,
patch accepted).

Jan Jongboom

unread,
Mar 18, 2013, 12:43:11 PM3/18/13
to Jan Jongboom, jva...@mozilla.com
Alright, that's disappointing. if this is getting picked up I'm happy to help.

Jan Varga

unread,
Mar 18, 2013, 3:22:20 PM3/18/13
to dev...@lists.mozilla.org
Hi,
getEditable() shouldn't be so hard to implement (not trivial though), but
there's a bigger problem ...
FileHandle API doesn't work in child processes yet

However, we're collecting information about storage needs in b2g. This
information will be used to prioritize WebAPI team goals for following
quarters. So multiprocess FileHandle could be one of them if there's a
compelling enough use case.

Jan

Jan Jongboom

unread,
Mar 19, 2013, 6:20:45 AM3/19/13
to dev...@lists.mozilla.org
Hi Jan,

One of the things that we have (has ux wanted 1.x) is rotating images in the gallery. I wanted to do an actual replace of the file content to not mess up the metadata through getEditable(). At the moment there is no way to overwrite file contents (at least not to my knowledge) :-)

Jan Jongboom

unread,
Mar 19, 2013, 6:20:45 AM3/19/13
to mozilla...@googlegroups.com, dev...@lists.mozilla.org
On Monday, March 18, 2013 8:22:20 PM UTC+1, Jan Varga wrote:
0 new messages