ebidel / idb.filesystem.js

HTML5 Filesystem API polyfill using IndexedDB
https://www.npmjs.com/package/idb.filesystem.js
Other
487 stars 46 forks source link

fix truncate() when called with a file that hasn't been written to yet #20

Closed gwynjudd closed 11 years ago

gwynjudd commented 11 years ago

e.g., if you do:

getFile(..., function (f) { f.truncate(0) });

Taken by itself, this doesn't make sense to do, but it is valid by the spec, and in an filesystem API wrapper it can happen