bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

".." anomaly in "rmdir -p"?


From: Juergen Reuter
Subject: ".." anomaly in "rmdir -p"?
Date: Fri, 24 Aug 2007 15:47:47 +0200 (CEST)

Hi all,

I do not know if this is a bug or a feature, but suppose the following situation:

Assume you create two subdirectories:

mkdir dir1
mkdir dir2

Now, if you say

rmdir -p dir1

dir1 is removed as expected and no further action is taken. Howver, if you instead say:

rmdir -p dir2/../dir1

(which after expansion denotes the same directory) then you get the error message "dir2/..: Directory not empty", probably since ".." is handled like an ordinary directory segment specifier. You frequently get expressions like "dir2/../dir1" in Makefiles, when paths are concatenated.

I wonder, if rmdir should remove by file path expansion all occurrences of ".." and "." from the path before taking any further action. This would avoid the above annoying behavior. Or does the Posix standard demand the current behavior?

Btw., I am referring to coreutils 6.9 on a linux redhat fc7 system.

[When answering, please cc: to me, since I am not subscribed to this list. Thanks!]

Greetings,
Juergen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]