You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[gap] rmdir deletes directory symlinks and NTFS junctions (GNU refuses: Not a directory) #1062
rmdir deletes directory symlinks and NTFS junctions. GNU rmdir refuses: a symlink is not a directory (failed to remove 'dlink': Not a directory, rc=1); only rm removes links. On Windows this happens because RemoveDirectoryW removes the reparse point itself.
Setup: dlink -> realdir (native dir symlink via MSYS=winsymlinks:nativestrict ln -s), jlink (junction via mklink /J).
Repro
winuxcmd.exe rmdir dlink -> rc=0, the SYMLINK IS DELETED (realdir untouched)
winuxcmd.exe rmdir jlink -> rc=0, the JUNCTION IS DELETED
GNU:
rmdir dlink -> rmdir: failed to remove 'dlink': Not a directory rc=1 (link kept)
rmdir jlink -> rmdir: failed to remove 'jlink': Not a directory rc=1
(rmdir link.txt on a FILE symlink correctly errors "Not a directory" in both — only dir-symlinks/junctions pass through.)
Distinct from #279 (which covers rmdir symlink/ trailing-slash forms); this is plain rmdir symlink.
Fixed/verified in b9211d5 — GNU expression parser for test/[, rmdir refuses dir symlinks+junctions with GNU diagnostics, mkdir EEXIST/deep-path fixes, rm --no-preserve-root abbreviation refusal, chmod -v GNU output. Verified vs WSL coreutils 9.4.
Activity
caomengxuan666 commentedon Sep 14, 2026
Fixed/verified in b9211d5 — GNU expression parser for test/[, rmdir refuses dir symlinks+junctions with GNU diagnostics, mkdir EEXIST/deep-path fixes, rm --no-preserve-root abbreviation refusal, chmod -v GNU output. Verified vs WSL coreutils 9.4.
fix(rm,rmdir,mkdir,test,[,chmod): GNU expr parser and operand semantics