doc: add example for chmod in fs.md
PR-URL: https://github.com/nodejs/node/pull/28365 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
c03df4c75d
commit
41fad84035
@ -1243,6 +1243,13 @@ possible exception are given to the completion callback.
|
||||
|
||||
See also: chmod(2).
|
||||
|
||||
```js
|
||||
fs.chmod('my_file.txt', 0o775, (err) => {
|
||||
if (err) throw err;
|
||||
console.log('The permissions for file "my_file.txt" have been changed!');
|
||||
});
|
||||
```
|
||||
|
||||
### File modes
|
||||
|
||||
The `mode` argument used in both the `fs.chmod()` and `fs.chmodSync()`
|
||||
|
Loading…
x
Reference in New Issue
Block a user