Method description:
This method rewrites the read and write permissions of the file in an asynchronous manner.
The callback after the operation is completed only receives one parameter, and exception information may appear.
Grammar:
fs.chmod(path, mode, callback)
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)
3. callback callback
Example:
Source code: