Skip to content

Commit e07c335

Browse files
committed
fs: move chmod example to parent section
1 parent 4be1f41 commit e07c335

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/api/fs.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,13 @@ possible exception are given to the completion callback.
12431243

12441244
See also: chmod(2).
12451245

1246+
```js
1247+
fs.chmod('my_file.txt', 775, (err) => {
1248+
if (err) throw err;
1249+
console.log('The permissions for file "my_file.txt" have been changed!');
1250+
});
1251+
```
1252+
12461253
### File modes
12471254

12481255
The `mode` argument used in both the `fs.chmod()` and `fs.chmodSync()`
@@ -1293,13 +1300,6 @@ Caveats: on Windows only the write permission can be changed, and the
12931300
distinction among the permissions of group, owner or others is not
12941301
implemented.
12951302

1296-
```js
1297-
fs.chmod('my_file.txt', 775, (err) => {
1298-
if (err) throw err;
1299-
console.log('The permissions for file "my_file.txt" have been changed!');
1300-
});
1301-
```
1302-
13031303
## fs.chmodSync(path, mode)
13041304
<!-- YAML
13051305
added: v0.6.7

0 commit comments

Comments
 (0)