Skip to content

Clarify "fs.readFile", "fs.appendFile", "fs.writeFile" documentation regarding closing #7560

Description

@kibertoad

"https://nodejs.org/api/fs.html#fs_fs_readfile_file_options_callback" states that

Note: Specified file descriptors will not be closed automatically.

This is confusing for new users, because it implies that opened file should always be manually closed, leading to questions like this - http://stackoverflow.com/questions/21523890/close-file-after-fs-readfile-nulling

It should be mentioned that if "file" is specified as a filename, it will, indeed, be closed automatically.

Activity

  1. kibertoad commented on Jul 6, 2016

    @kibertoad
    ContributorAuthor

    Here is the pull request: #7561

  2. added
    docIssues and PRs related to Node.js documentation.
    fsIssues and PRs related to file-system APIs and the fs module.
    on Jul 6, 2016
  3. kibertoad commented on Jul 9, 2016

    @kibertoad
    ContributorAuthor

    Emmm, so what is left before this change can be pulled?..

  4. kibertoad commented on Jul 15, 2016

    @kibertoad
    ContributorAuthor

    I have two LGTMs on the pull request. If current blocker is the latest comment from the fourth reviewer, could I get a second opinion on that? Currently I have doubts about whether the suggested change should be made, but if someone else agrees it would be for the best, I'll make it.

  5. addaleax commented on Jul 15, 2016

    @addaleax
    Member

    @kibertoad For one, it’s a bit confusing to see comments that are only about the PR to pop up on the thread for the corresponding issue. ;)

  6. kibertoad commented on Jul 15, 2016

    @kibertoad
    ContributorAuthor

    @addaleax True, but for some reason comments about the PR inside the PR are ignored :). What would be the more appropriate way to keep things progressing?

  7. addaleax commented on Jul 15, 2016

    @addaleax
    Member

    @kibertoad I think the occasional “ping”/“bump”/… comment on a PR which hasn’t received feedback for a couple of days is pretty much okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions