Skip to content

fs.open differences on windows vs *nix #3643

@evanlucas

Description

@evanlucas

If you create a directory, and then try to use fs.open to open it, you get differing behavior on windows and *nix if the flags are a+.

Example:

// OS X
fs.open('<directory>', 'a+', console.log)
// => [Error: EISDIR: illegal operation on a directory, open <directory>]

// Windows
fs.open('<directory>', 'a+', console.log)
// => null <fd>

After looking through the libuv code, it looks like https://github.com/libuv/libuv/blob/v1.x/src/win/fs.c#L479-L480 is responsible for this. Is this intended or should this operation show the same behavior 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.libuvIssues and PRs related to the libuv dependency or the uv binding.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions