Closed
Bug 831319
Opened 12 years ago
Closed 12 years ago
FileHandle Simple write then read doesn't work
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: bruant.d, Unassigned)
References
Details
Attachments
(1 file)
(deleted),
application/javascript
|
Details |
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.
Comment 1•12 years ago
|
||
Just add |lf.location = 0;| before |var text = lf.readAsText(2)|
Each write() increases location by the size of passed text/blob/arraybuffer.
Comment 2•12 years ago
|
||
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.
Reporter | ||
Comment 3•12 years ago
|
||
(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
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•