Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!lemans.dec.com!lemans.det.dec.com!libove From: libove@libove.det.dec.com (Jay Vassos-Libove) Newsgroups: comp.unix.ultrix Subject: Re: Ultrix 4.1 still has the mv/rename symlink bug? Message-ID: Date: 30 Jan 91 15:58:21 GMT References: <1991Jan29.221803.28905@watcgl.waterloo.edu> Sender: news@lemans.dec.com Organization: Digital Equipment Corporation, Detroit Ultrix Resource Center Lines: 52 In-reply-to: idallen@watcgl.waterloo.edu's message of 29 Jan 91 22:18:03 GMT In article <1991Jan29.221803.28905@watcgl.waterloo.edu> idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL]) writes: Actually, this is probably a feature you are seeing... If you execute % ln -s foo bar then you are making the file "bar" point to a file "foo" _in the current directory_ - wherever that current directory is located at the time of reference to the file bar. Script started on Wed Jan 30 10:52:39 1991 % cd /tmp % mkdir a foo % ln -s foo bar % # so now /tmp/foo is a pointer to ./bar - where ./ varies as you cd! % cd a % mkdir xxx % mv xxx /tmp/bar/xxx mv: /tmp/bar/xxx: rename: No such file or directory % # as expected, since /tmp/a/bar does not exist % cd .. % rm bar % ln -s /tmp/foo bar % # so now /tmp/bar is a pointer to /tmp/foo % cd a % mv xxx ../bar % ls -l .. drwxr-x--- 2 libove 512 Jan 30 10:53 a lrwxr-x--- 1 libove 8 Jan 30 10:53 bar -> /tmp/foo drwxr-x--- 3 libove 512 Jan 30 10:53 foo % ls -l ../foo ../bar lrwxr-x--- 1 libove 8 Jan 30 10:53 ../bar -> /tmp/foo ../foo: total 1 drwxr-x--- 2 libove 512 Jan 30 10:53 xxx % exit script done on Wed Jan 30 10:53:13 1991 This can really get you if you're in /usr/tmp (a symlink to var/tmp) and you try to move directories around. Now, it is true that /usr/tmp -> var/tmp so indeed this might cause troubles... but I'd like to see a particular example, since you can't move a directory across a filesystem boundary anyway! -- Jay Vassos-Libove libove@libove.det.dec.com Digital Equipment Corporation decwrl!libove.det.dec.com!libove Detroit ACT/Ultrix Resource Center Opinions? They're mine, mine, all mine! Farmington Hills, Michigan and D.E.C. Can't have 'em!