FileSystemModule.writeBufferToFile(filename, data) Method (JS)
Asynchronously writes an ArrayBuffer
to a file.
Example
var FileSystem = require("FuseJS/FileSystem");
var data = new ArrayBuffer(4);
var view = new Int32Array(data);
view[0] = 0x1337;
FileSystem.writeBufferToFile(FileSystem.dataDirectory + "/" + "myfile.txt", data)
.then(function() {
console.log("Successful write");
}, function(error) {
console.log(error);
});
Location
- Namespace
- Fuse.FileSystem
- Package
- Fuse.FileSystem 2.9.1
Returns
Promise
A Promise of nothing.