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)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bruant.d, Unassigned)

References

Details

Attachments

(1 file)

(deleted), application/javascript
Details
Attached file test case (deleted) —
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.
Blocks: 726593
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
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: