我haved创建的文件夹,代码就像为什么我不能在文件夹中创建文件,XPCOM
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
filePath = path;
file.initWithPath(filePath);
if(file.exists() == false) {
file.create(0x01, 0644);
}
但是当我创建的文件夹中的文件,有一个错误显示这样的
错误:未捕获的异常:
[Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsILocalFile.create]" nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)"
有人能帮助我吗?
好的,谢谢! – user2473037