![]() |
VOOZH | about |
The fsPromises.lchmod() method is used to change the permissions of a given path. These permissions can be specified using string constants or octal numbers that correspond to their respective file modes.
Note: This method is only implemented on macOS. It changes the permissions of a file then resolves the Promise with no arguments upon success.
Syntax:
fsPromises.lchmod( path, mode)
Parameters: This method accepts two parameters as mentioned above and described below:
node index.js
Output:
File permission changed to read only! EPERMReference: https://nodejs.org/api/fs.html#fs_fspromises_lchmod_path_mode