Document why DirExt::access on Windows doesn't use their faccess equivalent

Open Beginner friendly
#416 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust

Research direction

Start by locating the Windows implementation of DirExt::access and read how it currently checks access by opening the file. Compare that approach with the linked Microsoft CRT APIs and faccess Windows implementation, then document the project’s rationale, including any dependency or auditing concerns that are confirmed. Done means the rationale is clear to readers without changing the implementation.

Written by the indexing model from the issue text.

Description

I noticed that your Windows implementation of DirExt::access just tries opening the file.

I understand if _access, _waccess, t_access or _access_s, _waccess_s, _taccess_s from the Microsoft C Runtime impose additional dependencies you want to avoid, and that the Win32 API-native version's overcomplicated credentials blow up to six pages in the faccess crate's Windows implementation (Link to the source file, MIT-licensed) once you address various edge cases.

However, I was unable to find any clear documentation for the rationale behind that. (Which I'm guessing is "auditing burden".)

Could that be improved, please?

Dominant language
Rust
Stars
821
Forks
59
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytecodealliance/cap-std

All issues in bytecodealliance/cap-std

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.