close
document.addEventListener("deviceready", onDeviceReady,false);function onDeviceReady(){ window.requestFileSystem(LocalFileSystem.PERSISTENT,0, gotFS, fail);}function gotFS(fileSystem){ fileSystem.root.getDirectory("data",{create:true}, gotDir);}function gotDir(dirEntry){ dirEntry.getFile("lockfile.txt",{create:true, exclusive:true}, gotFile);}function gotFile(fileEntry){// Do something with fileEntry here}
http://stackoverflow.com/questions/11077303/how-to-create-a-directory-and-file-in-that-directory-using-phonegap-file-api
全站熱搜