I\'m experimenting with the HTML5 File API, and I\'m needing to use a method which I don\'t know enough about (simply because it\'s hardly documented anywhere).
I\'m tal
Something like this might be a little more to the point:
truncate Changes the length of the file to that specified
fileEntry.createWriter(function(fileWriter) {
var truncated = false;
fileWriter.onwriteend = function(e) {
if (!truncated) {
truncated = true;
this.truncate(this.position);
return;
}
console.log('Write completed.');
};
fileWriter.onerror = function(e) {
console.log('Write failed: ' + e.toString());
};
var blob = new Blob(['helo'], {type: 'plain/text'});
fileWriter.write(blob);
}, errorHandler);