-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: improve fs api descriptions #17679
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -669,8 +669,10 @@ changes: | |
* `callback` {Function} | ||
* `err` {Error} | ||
|
||
Asynchronous chmod(2). No arguments other than a possible exception are given | ||
to the completion callback. | ||
Asynchronously changes the mode of a file. No arguments other than a possible | ||
exception are given to the completion callback. | ||
|
||
See also: chmod(2) | ||
|
||
## fs.chmodSync(path, mode) | ||
<!-- YAML | ||
|
@@ -685,7 +687,9 @@ changes: | |
* `path` {string|Buffer|URL} | ||
* `mode` {integer} | ||
|
||
Synchronous chmod(2). Returns `undefined`. | ||
The synchronous version of [`fs.chmod()`][]. Returns `undefined`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it duplicates content, but it would be ideal if this wasn't just a link to something else... e.g. this could be Synchronously change the permissions of a file or throw if unable to do so. Likewise for the other |
||
|
||
See also: chmod(2) | ||
|
||
## fs.chown(path, uid, gid, callback) | ||
<!-- YAML | ||
|
@@ -707,8 +711,10 @@ changes: | |
* `callback` {Function} | ||
* `err` {Error} | ||
|
||
Asynchronous chown(2). No arguments other than a possible exception are given | ||
to the completion callback. | ||
Asynchronously changes owner and group of a file. No arguments other than a | ||
possible exception are given to the completion callback. | ||
|
||
See also: chown(2) | ||
|
||
## fs.chownSync(path, uid, gid) | ||
<!-- YAML | ||
|
@@ -724,7 +730,9 @@ changes: | |
* `uid` {integer} | ||
* `gid` {integer} | ||
|
||
Synchronous chown(2). Returns `undefined`. | ||
Synchronous version of [`fs.chown()`][]. Returns `undefined`. | ||
|
||
See also: chown(2) | ||
|
||
## fs.close(fd, callback) | ||
<!-- YAML | ||
|
@@ -1511,8 +1519,10 @@ changes: | |
* `callback` {Function} | ||
* `err` {Error} | ||
|
||
Asynchronous mkdir(2). No arguments other than a possible exception are given | ||
to the completion callback. `mode` defaults to `0o777`. | ||
Asynchronously creates a directory. No arguments other than a possible exception | ||
are given to the completion callback. `mode` defaults to `0o777`. | ||
|
||
See also: mkdir(2) | ||
|
||
## fs.mkdirSync(path[, mode]) | ||
<!-- YAML | ||
|
@@ -1527,7 +1537,9 @@ changes: | |
* `path` {string|Buffer|URL} | ||
* `mode` {integer} **Default:** `0o777` | ||
|
||
Synchronous mkdir(2). Returns `undefined`. | ||
The synchronous version of [`fs.mkdir()`][]. Returns `undefined`. | ||
|
||
See also: mkdir(2) | ||
|
||
## fs.mkdtemp(prefix[, options], callback) | ||
<!-- YAML | ||
|
@@ -3103,10 +3115,13 @@ The following constants are meant for use with the [`fs.Stats`][] object's | |
[`fs.Stats`]: #fs_class_fs_stats | ||
[`fs.access()`]: #fs_fs_access_path_mode_callback | ||
[`fs.appendFile()`]: fs.html#fs_fs_appendfile_file_data_options_callback | ||
[`fs.chmod()`]: #fs_fs_chmod_path_mode_callback | ||
[`fs.chown()`]: #fs_fs_chown_path_uid_gid_callback | ||
[`fs.exists()`]: fs.html#fs_fs_exists_path_callback | ||
[`fs.fstat()`]: #fs_fs_fstat_fd_callback | ||
[`fs.futimes()`]: #fs_fs_futimes_fd_atime_mtime_callback | ||
[`fs.lstat()`]: #fs_fs_lstat_path_callback | ||
[`fs.mkdir()`]: #fs_fs_mkdir_path_mode_callback | ||
[`fs.mkdtemp()`]: #fs_fs_mkdtemp_prefix_options_callback | ||
[`fs.open()`]: #fs_fs_open_path_flags_mode_callback | ||
[`fs.read()`]: #fs_fs_read_fd_buffer_offset_length_position_callback | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe even go for “permissions” instead of “mode”? Is that clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, yes.