Skip to content

Commit

Permalink
fs: move chmod example to parent section
Browse files Browse the repository at this point in the history
  • Loading branch information
roadev committed Jun 25, 2019
1 parent 4be1f41 commit e07c335
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,13 @@ possible exception are given to the completion callback.

See also: chmod(2).

```js
fs.chmod('my_file.txt', 775, (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()`
Expand Down Expand Up @@ -1293,13 +1300,6 @@ Caveats: on Windows only the write permission can be changed, and the
distinction among the permissions of group, owner or others is not
implemented.

```js
fs.chmod('my_file.txt', 775, (err) => {
if (err) throw err;
console.log('The permissions for file "my_file.txt" have been changed!');
});
```

## fs.chmodSync(path, mode)
<!-- YAML
added: v0.6.7
Expand Down

0 comments on commit e07c335

Please sign in to comment.