Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
refs #7560 Clarify "fs.readFile", "fs.appendFile", "fs.writeFile" doc…
…umentation regarding closing.
  • Loading branch information
kibertoad committed Jul 6, 2016
commit e4a8d56a0b01733d02a6c3371dee3cdbb0a73a45
12 changes: 9 additions & 3 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ fs.appendFile('message.txt', 'data to append', 'utf8', callback);

Any specified file descriptor has to have been opened for appending.

_Note: Specified file descriptors will not be closed automatically._
_Note: If a file descriptor is specified as the 'file', it will not be closed automatically._

@Trott Trott Jul 6, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use backticks instead of single quotes around file here and in the other notes.

In other words:

`file`

instead of:

'file'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, replaced with the backticks in the new commit.


_Note: If a filename is specified as the 'file', internally opened file descriptor will be closed automatically._

## fs.appendFileSync(file, data[, options])
<!-- YAML
Expand Down Expand Up @@ -1130,7 +1132,9 @@ fs.readFile('/etc/passwd', 'utf8', callback);

Any specified file descriptor has to support reading.

_Note: Specified file descriptors will not be closed automatically._
_Note: If a file descriptor is specified as the 'file', it will not be closed automatically._

_Note: If a filename is specified as the 'file', internally opened file descriptor will be closed automatically._

## fs.readFileSync(file[, options])
<!-- YAML
Expand Down Expand Up @@ -1662,7 +1666,9 @@ Note that it is unsafe to use `fs.writeFile` multiple times on the same file
without waiting for the callback. For this scenario,
`fs.createWriteStream` is strongly recommended.

_Note: Specified file descriptors will not be closed automatically._
_Note: If a file descriptor is specified as the 'file', it will not be closed automatically._

_Note: If a filename is specified as the 'file', internally opened file descriptor will be closed automatically._

## fs.writeFileSync(file, data[, options])
<!-- YAML
Expand Down