Home > Article > Web Front-end > Instructions for using the fs.chmodSync method in node.js_node.js
Method description:
Synchronized version of chmod(), this method is used to rewrite the read and write permissions of files.
Grammar:
fs.chmodSync(path, mode)
Since this method belongs to the fs module, the fs module needs to be introduced before use (var fs = require(“fs”) )
Receive parameters:
1. path File path
2. mode read and write permissions (eg: 777)
Example:
Source code: