Skip to content

stdin fd doesn't works when it's a pipe #15497

@tai2

Description

@tai2

fs apis like fstatSync or readSync don't read state or data fed through pipe.

Reproducible code
https://wandbox.org/permlink/zU1uUULheUpxmgfN

cat data.txt | node prog.js # NG
node prog.js < data.txt # OK

But with stream api, it works properly.
https://wandbox.org/permlink/XW7rOuJQCCyqCFPX

This problem occurred only on linux as long as I tested, not on macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.invalidIssues and PRs that are invalid.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions