Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site sdcrdcf.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!jonab From: jonab@sdcrdcf.UUCP Newsgroups: net.bugs.4bsd Subject: Re: rm and symbolic links (4.2) Message-ID: <1119@sdcrdcf.UUCP> Date: Wed, 6-Jun-84 09:20:33 EDT Article-I.D.: sdcrdcf.1119 Posted: Wed Jun 6 09:20:33 1984 Date-Received: Fri, 8-Jun-84 01:33:44 EDT References: <214@hercules.UUCP> Reply-To: jonab@sdcrdcf.UUCP (Jonathan Biggar) Organization: System Development Corporation, Santa Monica Lines: 20 In article <214@hercules.UUCP> archiel@hercules.UUCP (Archie Lachner) writes: >I just found out the hard way that if one runs "rm -r" on a directory that >contains a symbolic link, the object that the link points to gets removed >(recursively). Since plain old "rm" run on a symbolic link removes the >link but NOT the object that it points to, I was surprised by this behavior >(no flames, please). > >This behavior is, in my opinion, not obvious until after you've experienced it. >I am submitting this so that no one who reads it will be similarly surprised. >Be careful of this one. It can really hurt! In my opinion, this is a bug, not a feature. A symbolic link should be treated as much like a hard link by the system as is possible. Thus the object pointed to by the symbolic link should be recusively removed only if the object is a directory, not if it is a normal file. This is what would happen if the link was a hard link, not a symbolic one. Jon Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,sdccsu3}!sdcrdcf!jonab