Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jul 1998 02:39:37 +0900
From:      Shigio Yamaguchi <shigio@wafu.netgate.net>
To:        hackers@FreeBSD.ORG
Cc:        shigio@wafu.netgate.net
Subject:   Improvemnet of ln(1).
Message-ID:  <199807101738.KAA12014@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807101738.KAA12014>