Support for renameat2?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- operating-systems
Research direction
Start with cap-std's Dir::rename and rustix::fs::renameat_with, then compare how filesystem operations are exposed across supported platforms. Read cap-std-ext's atomic-write implementation to understand the RENAME_NOREPLACE use case. Done means renameat2-style flags are supported where available and atomic creation can avoid overwriting an existing file.
Written by the indexing model from the issue text.
Description
On Linux, cap-std implements Dir::rename via rustix::fs::renameat, which is the renameat function.
Since Linux 3.15, there is another version of this call, renameat2, which supports an additional flags argument. rustix already supports this function as rustix::fs::renameat_with.
Could cap-std add support for this function as well?
Additional Context
The external cap-std-ext crate implements atomic writes by writing a temporary file and renaming it in place. However, it is not possible to atomically create a file in this way.
renameat2 supports the RENAME_NOREPLACE flag, which ensures that no existing file is overwritten by the rename. As such, an atomic_create could be implemented based on this change.
- Dominant language
- Rust
- Stars
- 821
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bytecodealliance/cap-std
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
bytecodealliance/cap-std#427 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bytecodealliance/cap-std#416 · 2 comments ·
-
Archiving cap-std Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
bytecodealliance/cap-std#426 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
bytecodealliance/cap-std#423 · 5 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
bytecodealliance/cap-std#408 · 4 comments · 2 reactions ·
All issues in bytecodealliance/cap-std
Similar issues
-
bug CLI custom-model
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100