Skip to content

Reading a directory #10962

Closed
Closed
@s0m3on3

Description

@s0m3on3
  • Version: 7.4.0
  • Subsystem: fs

If you try to read a directory, the behavior will be platform specific:

// linux/windows/os x
fs.readFileSync("node_modules");
// -> Error: EISDIR: illegal operation on a directory, read

// freebsd
fs.readFileSync("node_modules");
// -> <Buffer 03 00 00 ... >

Is it ok? I expected the same result on all platforms

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.fsIssues and PRs related to the fs subsystem / file system.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions