Date: Sun, 4 Feb 2001 12:15:08 +1000 From: Andrew Kenneth Milton <akm@mail.theinternet.com.au> To: Greg Black <gjb@gbch.net> Cc: hackers@FreeBSD.ORG Subject: Re: Trailing slashes and rmdir - POLA broken Message-ID: <20010204121508.C1511@zeus.theinternet.com.au> In-Reply-To: <nospam-3a7c6e285f01132@maxim.gbch.net>; from Greg Black on Sun, Feb 04, 2001 at 06:46:32AM %2B1000 References: <nospam-3a7c6e285f01132@maxim.gbch.net>
next in thread | previous in thread | raw e-mail | index | archive | help
+-------[ Greg Black ]---------------------- | Observe the following: | | $ uname -rs | FreeBSD 4.1-RELEASE | $ ls -l | $ mkdir foo | $ ln -s foo bar | $ rmdir bar | rmdir: bar: Not a directory | | So far, so good -- but look at this: | | $ rmdir bar/ | $ ls -l | total 0 | lrwxrwx--- 1 gjb wheel 3 Feb 4 06:35 bar -> foo | $ for kicks notice the difference between cp -R foo and cp -R foo/ foo doesn't have to be a symlink. the cp manpage doesn't mention this; -R If source_file designates a directory, cp copies the directory and the entire subtree connected at that point. This option also caus- es symbolic links to be copied, rather than indirected through, and for cp to create special files rather than copying them as normal files. Created directories have the same mode as the corresponding source directory, unmodified by the process' umask. foo and foo/ both designate a directory (if foo is not a symlink). thank god for setopt auto_remove_slash in zsh d8) -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au| To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010204121508.C1511>