From owner-freebsd-hackers Fri Jul 10 10:38:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA12026 for freebsd-hackers-outgoing; Fri, 10 Jul 1998 10:38:43 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from wafu.netgate.net (wafu.netgate.net [204.145.147.80]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id KAA12014 for ; Fri, 10 Jul 1998 10:38:37 -0700 (PDT) (envelope-from shigio@wafu.netgate.net) Message-Id: <199807101738.KAA12014@hub.freebsd.org> Received: (qmail 24502 invoked from network); 10 Jul 1998 09:38:22 -0000 Received: from ins11.tama-ap3.dti.ne.jp (HELO choota.signet.or.jp) (203.181.67.11) by wafu.netgate.net with SMTP; 10 Jul 1998 09:38:22 -0000 Received: from choota.signet.or.jp (localhost [127.0.0.1]) by choota.signet.or.jp (8.8.7/) with ESMTP id CAA00918; Sat, 11 Jul 1998 02:39:37 +0900 (JST) To: hackers@FreeBSD.ORG Cc: shigio@wafu.netgate.net Subject: Improvemnet of ln(1). Date: Sat, 11 Jul 1998 02:39:37 +0900 From: Shigio Yamaguchi Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dear all I'm thinking about improvement of ln(1). [Problem] Ln(1) with -s option makes illegal symbolic link in some case. For example, (Both '/usr/src/sys' and '/tmp' are real directories.) % cd /usr % ln -s src/sys /tmp % ls -l /tmp/sys lrwxrwxrwx 1 shigio wheel 7 Jul 11 02:03 /tmp/sys -> src/sys % cd /tmp/sys /tmp/sys: No such file or directory. Symbolic link '/tmp/sys' has illegal value, so we cannot move there. Above behavior is not desireble in almost case, I think. [Solution] It would be more useful if ln(1) works like follows. Two options are added. Both of them is valid only with -s option. -r option: make right and relative symbolic link -a option: make right and absolute symbolic link (-r and -a cannot be used at a same time.) % cd /usr % ln -sr src/sys /tmp % ls -l /tmp/sys lrwxrwxrwx 1 shigio wheel 14 Jul 11 02:00 /tmp/sys -> ../usr/src/sys % cd /tmp/sys % pwd /usr/src/sys % cd /usr % ln -sa src/sys /tmp % ls -l /tmp/sys lrwxrwxrwx 1 shigio wheel 12 Jul 11 02:02 /tmp/sys -> /usr/src/sys % cd /tmp/sys % pwd /usr/src/sys New version of ln(1) makes right symbolic link. [Question] Is it improvement? Is it useful? Is it the right way to do it? Is there any problem made by this solution? Comment appreciated. Thank you in advance. -- Shigio Yamaguchi (Freelance programmer) Mail: shigio@wafu.netgate.net, WWW: http://wafu.netgate.net/tama/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message