Skip to content

std::fs::remove_dir_all doesn't handle paths that are too long #53339

Open
@drrlvn

Description

@drrlvn

On Linux unlink() might fail with ENAMETOOLONG but std::fs::remove_dir_all doesn't handle that and ignores the error, leaving the directory as it was.

When the path is too long a parent directory should be open()ed instead and unlinkat() should be called with the relative path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.O-linuxOperating system: LinuxT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions