Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support for renameat2? #406

Open
Open

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /