質問

I modified the Writing to a file example such that I can store some text from an input. I am storing the text aaaaaaaaaa to the file and afterwards the shorter bbbbb to the same file with the same function.

Additionally I am using the Reading a file by name example to read the file. I am getting -- with Chromium 15 -- this result:

bbbbbaaaaa

How can I reset the content of a file? The spec just offers getBlob() and append().

役に立ちましたか?

解決

There's a "truncate" method on the FileWriter interface. (It works more like a "setFileSize" method, in that it's possible to "truncate" a file to a larger size than it already has.)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top