Skip to content

FS constants says not all constants are available on all platforms, but it doesn't say which ones are available on what platforms #41591

Closed
@dead-claudia

Description

@dead-claudia

Affected URL(s)

https://nodejs.org/api/fs.html#fsconstants

Description of the problem

It says the following:

Not every constant will be available on every operating system.

However, this doesn't say anything else about the availability of various constants. In particular, none of the file mode constants are available on Windows and about half of the file type constants are also not present, but the docs don't even so much as hint at this. (I initially thought this to be a bug and filed #41590, so it's definitely confusing.) Part of what makes it non-obvious is the fact many of the various Unix-based constants (both in fs and elsewhere like with many signals) are shimmed on Windows in terms of corresponding Windows APIs, and so I can't just assume for all of them. (In particular, fs.constants.O_DIRECTORY is missing from Windows despite fs.opendir using Windows APIs similar to POSIX's opendir - that one was very surprising.)

Could the series of tables be updated to include platform availability for each relevant constant?

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