Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jul 1998 22:18:05 +0900 (JST)
From:      shigio@wafu.netgate.net
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/7298: Improvements to ln(1).
Message-ID:  <199807161316.GAA08055@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         7298
>Category:       bin
>Synopsis:       Improvements to ln(1).
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 16 06:20:01 PDT 1998
>Last-Modified:
>Originator:     Shigio Yamaguchi
>Organization:
Freelance programmer
>Release:        FreeBSD 2.2.5-RELEASE i386
>Environment:

	All environment.

>Description:

	I have hacked ln(1) and added -r and -a option.

	     -a    If the -s option is specified, make absolute symbolic link.
	     -r    If the -s option is specified, make relative symbolic link.
	     The -a and -r options override each other; the last one specified deter-
	     mines the method used.

	These options work like follows.

	% cd /usr/src/sys
	% ln -sfr kern/tty.c /usr/obj/usr/src/sys/kern
	% ls -l /usr/obj/usr/src/sys/kern/tty.c
	lrwxrwxrwx  1 shigio  bin  29 Jul 16 21:55 /usr/obj/usr/src/sys/kern/tty.c ->
					../../../../../src/kern/tty.c
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
					(right and relative symbolic link)

	% cd /usr/src/sys
	% ln -sfa kern/tty.c /usr/obj/usr/src/sys/kern
	% ls -l /usr/obj/usr/src/sys/kern/tty.c
	lrwxrwxrwx  1 shigio  bin  19 Jul 16 21:57 /usr/obj/usr/src/sys/kern/tty.c ->
					/usr/src/kern/tty.c
					~~~~~~~~~~~~~~~~~~~
					(right and absolute symbolic link)

	Note that both symbolic links are right.

>How-To-Repeat:

	It is not a bug but neither -r nor -a option specified, the result is

	% cd /usr/src/sys
	% ln -sf kern/tty.c /usr/obj/usr/src/sys/kern
	% ls -l /usr/obj/usr/src/sys/kern/tty.c
	lrwxrwxrwx  1 shigio  bin  10 Jul 16 21:59 /usr/obj/usr/src/sys/kern/tty.c ->
					kern/tty.c
					~~~~~~~~~~
					(wrong symbolic link)
	% cat /usr/obj/usr/src/sys/kern/tty.c
	cat: /usr/obj/usr/src/sys/kern/tty.c: No such file or directory

>Fix:
	
	Source code is here. It includes Makefile, related library source and
	online manuals too.

	ftp://ftp.freebsd.org/pub/FreeBSD/incoming/pathconvert4.tar.gz

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



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