Created
February 11, 2013 23:47
-
-
Save shazron/4758724 to your computer and use it in GitHub Desktop.
Get a FileEntry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getFileEntry(localFileSystem, filePath, onGetFileWin, onGetFileFail) | |
| { | |
| var onFSWin = function(fileSystem) { | |
| fileSystem.root.getFile(filePath, {create: true, exclusive: false}, onGetFileWin, onGetFileFail); | |
| } | |
| var onFSFail = function(evt) { | |
| console.log(evt.target.error.code); | |
| } | |
| window.requestFileSystem(localFileSystem, 0, onFSWin, onFSFail); | |
| } | |
| var onGetFileWin = function(entry) { | |
| // TODO: do something with the FileEntry entry | |
| } | |
| var onGetFileFail = function() { | |
| console.log("error getting file") | |
| } | |
| getFileEntry(LocalFileSystem.PERSISTENT, "MyApp/myfile.txt", onGetFileWin, onGetFileFail); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment