我正在使用文档中的示例代码,并且只执行第一个写实例。该函数在此之后结束,没有错误。
生成的文件包含文本:“some sample text”
有什么想法吗?
function gotFileWriter(writer) {
writer.onwrite = function(evt) {
console.log("write success");
};
writer.write("some sample text");
// contents of file now 'some sample text'
writer.truncate(11);
// contents of file now 'some sample'
writer.seek(4);
// contents of file still 'some sample' but file pointer is after the 'e' in 'some'
writer.write(" different text");
// contents of file now 'some different text'
}