Date: Sun, 25 Oct 1998 13:13:56 +0100 From: Marc Olzheim <marcolz@stack.nl> To: freebsd-questions@FreeBSD.ORG Cc: unix@stack.nl Subject: Strange symlink behaviour Message-ID: <19981025131356.A12915@stack.nl>
next in thread | raw e-mail | index | archive | help
Hi. I found some strange (at least to my perception) behaviour of symlinks using FreeBSD. All versions of FreeBSD I checked it on showed it: 2.1.0-RELEASE 2.1.5-RELEASE 2.2.5-RELEASE 2.2.6-RELEASE 2.2.7-RELEASE snail:/tmp/test>ls -l total 2 -rw-r--r-- 1 marcolz bin 0 Oct 25 12:46 a -rw-r--r-- 1 marcolz bin 1 Oct 25 12:46 b -rw-r--r-- 1 marcolz bin 2 Oct 25 12:46 c lrwxrwxrwx 1 marcolz bin 1 Oct 25 12:46 d -> a lrwxrwxrwx 1 marcolz bin 1 Oct 25 12:46 e -> b snail:/tmp/test>mv c d snail:/tmp/test>ls -l total 2 -rw-r--r-- 1 marcolz bin 0 Oct 25 12:46 a -rw-r--r-- 1 marcolz bin 1 Oct 25 12:46 b -rw-r--r-- 1 marcolz bin 2 Oct 25 12:46 d lrwxrwxrwx 1 marcolz bin 1 Oct 25 12:46 e -> b This seems OK, but: snail:/tmp/test>mv d e/ snail:/tmp/test>ls -l total 1 -rw-r--r-- 1 marcolz bin 0 Oct 25 12:46 a -rw-r--r-- 1 marcolz bin 2 Oct 25 12:46 b lrwxrwxrwx 1 marcolz bin 1 Oct 25 12:46 e -> b snail:/tmp/test> Is this normal behaviour ? following the link if there's a '/' appended ? I mean it isn't a directory or a link to one... And if this is normal: how to follow two links then ? since: snail:/tmp/test>ls -l total 1 -rw-r--r-- 1 marcolz bin 0 Oct 25 12:54 a lrwxrwxrwx 1 marcolz bin 1 Oct 25 12:54 b -> a lrwxrwxrwx 1 marcolz bin 1 Oct 25 12:54 c -> b -rw-r--r-- 1 marcolz bin 1 Oct 25 12:55 d snail:/tmp/test>mv d c// snail:/tmp/test>ls -l total 1 -rw-r--r-- 1 marcolz bin 0 Oct 25 12:54 a -rw-r--r-- 1 marcolz bin 1 Oct 25 12:55 b lrwxrwxrwx 1 marcolz bin 1 Oct 25 12:54 c -> b snail:/tmp/test> I'm quite eager to hear an explanation, since I couldn't find anything about this in the man pages or in the FAQ. Marc To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981025131356.A12915>