Add os.linkat() function to create a hard link with flags
未关闭
还没有人认领这个 Issue。
extension-modules
type-feature
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读 issue 136156 中的相关讨论和链接的 PR 136417,然后检查 os.link() 当前如何公开 linkat() 和 AT_SYMLINK_FOLLOW。完成的标准是实现 os.linkat() 的拟议行为以及 AT_FDCWD、AT_SYMLINK_FOLLOW 和 AT_EMPTY_PATH 常量,并进行适当的平台处理。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- operating-systems
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100