Add os.linkat() function to create a hard link with flags
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
os.link() can call linkat() but it only supports AT_SYMLINK_FOLLOW flag (follow_symlinks=True), it doesn't support AT_EMPTY_PATH. I propose adding the os.linkat() function to create a hard link with flags, and add the following constants:
- os.AT_FDCWD
- os.AT_SYMLINK_FOLLOW
- os.AT_EMPTY_PATH
AT_EMPTY_PATH allows creating a hard link from an unnamed name even if /proc is not mounted.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
https://github.com/python/cpython/issues/136156
Linked PRs
- gh-136417
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.
Research direction
Start by reading the related discussion in issue 136156 and the linked PR 136417, then inspect how os.link() currently exposes linkat() and AT_SYMLINK_FOLLOW. Done means the proposed os.linkat() behavior and the AT_FDCWD, AT_SYMLINK_FOLLOW, and AT_EMPTY_PATH constants are implemented with appropriate platform handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100