Skip to content

fix: remove Windows directory symlinks recursively#89

Closed
a-rookie-of-C-language wants to merge 1 commit into
microsoft:mainfrom
a-rookie-of-C-language:fix/windows-rm-symlinkd
Closed

fix: remove Windows directory symlinks recursively#89
a-rookie-of-C-language wants to merge 1 commit into
microsoft:mainfrom
a-rookie-of-C-language:fix/windows-rm-symlinkd

Conversation

@a-rookie-of-C-language

Copy link
Copy Markdown
Contributor

close #84

Summary

  • Fix rm -rf on Windows directory symlinks (SYMLINKD).
  • Avoid treating directory symlinks as regular files during recursive removal.
  • Remove the link itself with the directory removal path instead of calling remove_file().
  • Avoid counting directory symlink targets recursively for progress accounting.

Validation

  • cargo check --manifest-path deps\coreutils\Cargo.toml -p uu_rm
  • cargo test --manifest-path deps\coreutils\Cargo.toml --features rm --test tests test_recursive_symlink_dir_removes_link_not_target

@lhecker lhecker added the C-bug It shouldn't be doing this. label Jun 9, 2026
@lhecker

lhecker commented Jul 21, 2026

Copy link
Copy Markdown
Member

If I remember correctly, you opened a PR in the upstream coreutils repo right?

@a-rookie-of-C-language

Copy link
Copy Markdown
Contributor Author

This: uutils/coreutils#12642

@lhecker

lhecker commented Jul 21, 2026

Copy link
Copy Markdown
Member

Ah thanks! I'll close this PR then. I hope we can merge your PR over there soon.

@lhecker lhecker closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug It shouldn't be doing this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't rm directory symbolic link

2 participants