Reputation: 239
I am creating a folder every time my code is executed in MAC but it is not having write permission to it due to which my code is failing once the folder is created
Upvotes: 2
Views: 4030
Reputation: 1156
You can set the permissions of the folder with fs.chmod
:
var fs = require('fs');
fs.chmod(pathToYourFolder, '755', function(err){
if(err){
//do soemthing with error
}
});
Upvotes: 2