Skip to content

Purpose of fs ReadStream.open #29050

Description

@ronag

I'm not quite sure I understand the purpose of ReadStream.open in fs? Why would I use this?

Opening the stream after closing it doesn't quite make sense and if passing an existing fd then it should already be opened.

Activity

  1. changed the title [-]fs ReadStream.open[/-] [+]Purpose of fs ReadStream.open[/+] on Aug 8, 2019
  2. added
    fsIssues and PRs related to file-system APIs and the fs module.
    questionIssues asking questions about Node.js.
    on Aug 9, 2019
  3. bnoordhuis commented on Aug 9, 2019

    @bnoordhuis
    Member

    The reason is lost in the mist of time. It was introduced in the exquisitely well documented commit 44b308b from 2012.

    I had some pretty strong misgivings about streams2 back then, among them that it had a lot of loose ends, and this was one of them. Isaac basically merged it without consulting anyone.

  4. ronag commented on Aug 9, 2019

    @ronag
    MemberAuthor

    Is it something we can deprecate? Remove from documentation?

  5. bnoordhuis commented on Aug 9, 2019

    @bnoordhuis
    Member

    I don't think it's documented. Removal would need to start with run-time deprecation, i.e, printing a deprecation notice on first use.

  6. ronag commented on Oct 6, 2019

    @ronag
    MemberAuthor

    Multiple PR's related to this.

  7. added a commit that references this issue on Dec 18, 2019
  8. added a commit that references this issue on Jan 3, 2020
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

    fsIssues and PRs related to file-system APIs and the fs module.questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions