【发布时间】:2015-07-31 10:15:03
【问题描述】:
我想使用 PhoneGap 和文件写入器将文件保存在新目录中。 我有这个代码:
fileName = fileSystem.root.fullPath+"/test.html";
var writer = new FileWriter(fileName);
writer.write("ttteeeesssttttt", false);
有了这个,我可以创建 test.html 文件并且它可以工作。 但是当我将路径更改为:
fileName = fileSystem.root.fullPath+"/test/test.html";
它不起作用....
有没有简单的方法来解决这个问题,还是我应该先在其他函数中创建目录?
谢谢! :)
【问题讨论】:
-
您需要明确创建目录,然后才能在其中创建文件
标签: javascript cordova mobile phonegap-plugins