Macos 在Chrome应用程序中,设置保存文件的文件权限
我正在构建一个Google Chrome打包应用程序,它有时需要能够将Blob保存到用户硬盘上的文件中 我的代码的基本特征如下:Macos 在Chrome应用程序中,设置保存文件的文件权限,macos,google-chrome,google-chrome-app,html5-filesystem,Macos,Google Chrome,Google Chrome App,Html5 Filesystem,我正在构建一个Google Chrome打包应用程序,它有时需要能够将Blob保存到用户硬盘上的文件中 我的代码的基本特征如下: var save = function(blobToSave) { // prompt user to choose a location for the saved file chrome.fileSystem.chooseEntry({type:'saveFile',suggestedName:'data.blob'},function(file)
var save = function(blobToSave) {
// prompt user to choose a location for the saved file
chrome.fileSystem.chooseEntry({type:'saveFile',suggestedName:'data.blob'},function(file){
// create writer to write the data to the chosen file
file.createWriter(function(fileWriter){
// write the data
fileWriter.write(blobToSave);
});
});
};
这很好,只是文件似乎总是以600权限保存(而不是用户的默认权限,在我的例子中是644)。IE组和其他组都无法读取
如何调整上述代码,以便:
a) 使用类似于chmod的方法设置文件权限。或
b) 使Chrome以用户的默认权限保存文件
如果有区别的话,我会在Mac OSX Snowleopard上使用Chrome v 31(但我想这同样适用于任何基于nix的操作系统)