Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!sumax!thebes!polari!6sigma2 From: 6sigma2@polari.UUCP (Brian Matthews) Newsgroups: comp.lang.perl Subject: Re: Nasty perl rename bug Message-ID: <1964@polari.UUCP> Date: 2 May 90 02:50:59 GMT References: <1952@polari.UUCP> <7930@jpl-devvax.JPL.NASA.GOV> Reply-To: 6sigma2@polari.UUCP (Brian Matthews) Organization: PolarServ, Seattle WA Lines: 12 In article <7930@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: |In article <1952@polari.UUCP> 6sigma2@polari.UUCP (Brian Matthews) writes: |: The rename emulation first unlinks the destination, but this is a Bad Thing |: if the source and dest are the same. |Ouch. And it's rather difficult to do it right, since two differing strings |may in fact refer to the same directory entry. Sigh... Let the kernel do the hard stuff :-) Just stat the two files, and do the obvious. In fact, it's probably fairly simple to do in perl itself, but it still needs to be done in C someday. -- Brian L. Matthews blm@6sceng.UUCP