Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created May 31, 2016 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rightfold/cf87b53f3c8bb7c3f614abe2444b85ea to your computer and use it in GitHub Desktop.
Save rightfold/cf87b53f3c8bb7c3f614abe2444b85ea to your computer and use it in GitHub Desktop.
function writeFile(path: string, content: Blob): void {
requestFileSystem(LocalFileSystem.PERSISTENT, 0, fs => {
fs.root.getFile(path, {create: true}, entry => {
entry.createWriter(writer => {
writer.write(content);
});
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment