Search code examples
javascriptnode.jspermissionsmkdirfs

In node.js app, mdkirSync('mydir',700) results in permission d-w------T


I have a node.js application creating a local directory in order to dump content. It uses the fs module:

fs.mkdirSync(pathToDir, 700);

The directory is indeed created locally on Openshift, but it has permissions:

d-w------T

How can I set the permission I am looking for?


Solution

  • Use octal number to set the right permissions:

    fs.mkdirSync(pathToDir, 0700);