私はphonegapファイルapiを使用してディレクトリを作成し、作成されたディレクトリにファイルを作成しています。ディレクトリが作成されていますが、ファイルがディレクトリに作成されていません。phonegapファイルapiを使用して、そのディレクトリにディレクトリとファイルを作成する方法は?
私が使用していたコードは次のとおりです。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}
function gotFS(fileSystem) {
var dataDir = fileSystem.root.getDirectory("data", {create: true});
var file = dataDir.getFile("lockfile.txt", {create: true, exclusive: true});
}
ディレクトリデータが作成されますが、lockfile.txt
が作成取得されていません。
simonさん、ありがとうございました。素晴らしいです... – mmathan
この回答に投票した人は、それがなぜ機能しないのか説明したいのですか? –
このディレクトリをどこに保存するのか分かりますか? – SSS