Skip to content

rm: improve handling of very deep directories with -r #7324

Open
@jfinkels

Description

@jfinkels

In pull request #7304, we added a "quick fix" to support removing very deep directories with rm -r. The corresponding test case in GNU coreutils is in tests/rm/deep-2.sh. It would be better to have a more robust solution.

The issue is that calling path.metadata() on a path that is too long returns an InvalidFilename error. Instead what we should do is use a relative path name and keep setting the working directory as we recurse. It must be possible because std::fs::remove_dir_all(path) seems to work on the very long path.

Originally posted by @jfinkels in #7304 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions