summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJuan Roa <jdroa92@gmail.com>2019-06-21 16:56:56 -0500
committerMichaƫl Zasso <targos@protonmail.com>2019-07-20 11:05:16 +0200
commite83b2563061f75ae1351c12cdc58029cb93cb708 (patch)
tree25159a87ba5bc650afcaacf0386032d49da0bff9 /doc
parentc177a68c7fd23fdcdbc56b33c257844736008985 (diff)
downloadandroid-node-v8-e83b2563061f75ae1351c12cdc58029cb93cb708.tar.gz
android-node-v8-e83b2563061f75ae1351c12cdc58029cb93cb708.tar.bz2
android-node-v8-e83b2563061f75ae1351c12cdc58029cb93cb708.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>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/fs.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md
index 772d1dc8e4..62c07160f1 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -1181,6 +1181,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()`