diff options
author | Juan Roa <jdroa92@gmail.com> | 2019-06-21 16:56:56 -0500 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-07-03 22:24:49 +0200 |
commit | 41fad84035daa37baf07a888322b2f17dd1d563c (patch) | |
tree | 70c5d005880677e3c24408f9b722054034e127ac | |
parent | c03df4c75d7ca9688865701b553e3843f80fda52 (diff) | |
download | android-node-v8-41fad84035daa37baf07a888322b2f17dd1d563c.tar.gz android-node-v8-41fad84035daa37baf07a888322b2f17dd1d563c.tar.bz2 android-node-v8-41fad84035daa37baf07a888322b2f17dd1d563c.zip |
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>
-rw-r--r-- | doc/api/fs.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index a637a22edc..3834131d8d 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -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()` |