Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Dec 22, 2017

Some fs doc improvements

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Dec 22, 2017
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!');
Copy link
Contributor

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');
Copy link
Contributor

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right most -> right-most ?

Copy link
Contributor

@maclover7 maclover7 left a 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);
Copy link
Contributor

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
Copy link
Contributor

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()

Copy link
Contributor

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.
Copy link
Member

@Trott Trott Dec 23, 2017

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.
Copy link
Member

@Trott Trott Dec 23, 2017

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.

@starkwang starkwang added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 28, 2017
@starkwang
Copy link
Contributor

@starkwang
Copy link
Contributor

@jasnell CI seems failed:

03:44:05 Running Markdown linter on docs...
03:44:39 doc/api/fs.md
03:44:39   3460:1-3460:73  warning  Found unused definition  no-unused-definitions  remark-lint
03:44:39 
03:44:39 ⚠ 1 warning

@jasnell
Copy link
Member Author

jasnell commented Dec 28, 2017

jasnell added a commit that referenced this pull request Dec 28, 2017
PR-URL: #17831
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented Dec 28, 2017

Landed in 286a5d0

@jasnell jasnell closed this Dec 28, 2017
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 29, 2017
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
PR-URL: #17831
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
PR-URL: #17831
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
PR-URL: #17831
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
gibfahn pushed a commit that referenced this pull request Jan 24, 2018
PR-URL: #17831
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants