Skip to content

Add os.linkat() function to create a hard link with flags #136413

Open
@vstinner

Description

@vstinner

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:

#136156

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions