-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: fs doc improvements #17831
doc: fs doc improvements #17831
Conversation
doc/api/fs.md
Outdated
fs.accessSyc('etc/passwd', fs.constants.R_OK | fs.constants.W_OK); | ||
console.log('can read/write'); | ||
} catch (err) { | ||
console.log('no access!'); |
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.
A nit: maybe console.error('no access!')
?
doc/api/fs.md
Outdated
|
||
try { | ||
fd = fs.openSync('message.txt', 'a'); | ||
fs.appendFile(fd, 'data to append', 'utf8'); |
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.
appendFile
-> appendFileSync
doc/api/fs.md
Outdated
An easier method of constructing the `mode` is to use a sequence of three | ||
octal digits (e.g. `765`). The left-most digit (`7` in the example), specifies | ||
the permissions for the file owner. The middle digit (`6` in the example), | ||
specifies permissions for the group. The right most digit (`5` in the example), |
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.
right most -> right-most ?
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.
two small comments
doc/api/fs.md
Outdated
|
||
```js | ||
try { | ||
fs.accessSyc('etc/passwd', fs.constants.R_OK | fs.constants.W_OK); |
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.
accessSyc --> accessSync
doc/api/fs.md
Outdated
@@ -846,10 +870,21 @@ If `options` is a string, then it specifies the encoding. Example: | |||
fs.appendFile('message.txt', 'data to append', 'utf8', callback); | |||
``` | |||
|
|||
Any specified file descriptor has to have been opened for appending. | |||
The `file` may be specified as a numeric file descriptor that has been opened | |||
for appending (using `fs.open()` or `fs.openSync()`. It is important to note |
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.
needs closing parenthesis after openSync()
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.
+ The same for fs.appendFileSync()
note.
doc/api/fs.md
Outdated
|
||
The `file` may be specified as a numeric file descriptor that has been opened | ||
for appending (using `fs.open()` or `fs.openSync()`. It is important to note | ||
that the file descriptor will not be closed automatically. |
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.
Suggestion: It is important to note that the file descriptor will not be closed automatically.
-> The file descriptor will not be closed automatically.
doc/api/fs.md
Outdated
Any specified file descriptor has to have been opened for appending. | ||
The `file` may be specified as a numeric file descriptor that has been opened | ||
for appending (using `fs.open()` or `fs.openSync()`. It is important to note | ||
that the file descriptor will not be closed automatically. |
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.
Suggestion: It is important to note that the file descriptor will not be closed automatically.
-> The file descriptor will not be closed automatically.
@jasnell CI seems failed:
|
PR-URL: #17831 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Landed in 286a5d0 |
PR-URL: #17831 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #17831 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #17831 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #17831 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Some fs doc improvements
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc