Skip to content

fs file access constants are nearly useless on Windows #36922

Description

@opalokha

📗 API Reference Docs Problem

  • Version: v12.18.3 (and all other version as far as I can tell)
  • Platform: Windows (32- and 64-bit)
  • Subsystem: fs

Location

Section of the site where the content exists

Affected URL(s):

Description

Concise explanation of the problem

File access constants are basically useless on Windows due to ACL not being checked. ACL being a primary way to regulate file access in Windows, in 99% of cases R_OK and W_OK will behave exactly like F_OK and will not provide any additional info, effectively failing in their purpose.

This commit is supposed to address this issue, but the info it adds is very easy to miss and does not highlight the significance of the implications (i.e. fs.access can only be used to check file existence on Windows).

I propose that a warning should be added to the constants' description, similar to the warning about X_OK being useless on Windows. The exact wording doesn't need to be the same (I presume there still are some cases in which R_OK/W_OK will throw on Windows), but there should be some warning.


  • I would like to work on this issue and
    submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions