Tag: createfile

使用选项“a”的Node.js fs.open生成EACCES错误

我正在尝试在POST请求上使用node.js的fs模块创buildxml文件。 filePath = path.normalize(path.join(profilesDirPath, name + xmlExt)); fs.exists(filePath, function(exists) { if (exists) { callback({ code: h.httpStatus.CONFLICT, resp: 'audio profile group with such name exists' }); return; } fs.open(filePath, 'a', function(error) { if (error) { callback({ code: h.httpStatus.INTERNAL_SERVER_ERROR, resp: error }); return; } callback(null); }); }); 这会导致错误: { "errno": 3, "code": "EACCES", "path": "/mount/fs/folder/newGroup.xml" } 节点进程运行在Linux和文件夹,我尝试创build这样的文件在同一台机器上。 […]