Created attachment 702834 [details] test case Test case attached. Since I'm calling the readAsText after the success of the write and both are async, I would expect to have 'yo' written in the file (and the .length to be 2), but I get the empty string. I see the empty string in both Firefox Aurora and Nightly There is also a probability that I'm misunderstanding the API since I'm discovering it.
Just add |lf.location = 0;| before |var text = lf.readAsText(2)| Each write() increases location by the size of passed text/blob/arraybuffer.
And don't be surprised when the file disappear (after a GC) when you leave the page. Just add the filehandle to an object store and it won't be deleted.
(In reply to Jan Varga [:janv] from comment #1) > Just add |lf.location = 0;| before |var text = lf.readAsText(2)| Ok. It works with this line. That's not a bug then. I'll be on dev-webapi to ask further questions. Thanks :-)
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.