Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jul 1998 08:48:16 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        joelh@gnu.org
Cc:        dchapes@ddm.on.ca, rminnich@Sarnoff.COM, hackers@FreeBSD.ORG
Subject:   Re: Improvemnet of ln(1).
Message-ID:  <199807110848.BAA16020@usr08.primenet.com>
In-Reply-To: <199807110708.CAA10210@detlev.UUCP> from "Joel Ray Holveck" at Jul 11, 98 02:08:46 am

index | next in thread | previous in thread | raw e-mail

> > I've many times used ln(1) to create what you call 'questionable links'
> > on purpose and I'd _hate_ warnings.
> 
> You frequently link to files that don't exist?  I generally consider
> that to be putting the cart before the cat(1), er, horse.  But it's
> your system.

I don't do it frequently, but yes, I do this occasionally.

In a number of cases, I do this in makefiles, and I do this to
create links into a non-existant object tree.


> > If someone insists on adding such warnings then do it like mv(1) and
> > cp(1) by adding an option to ln(1) turn it on.
> 
> You mean, in the style of the cp and mv which both sport -f, and one
> of which features the -R flag?

The "-f" flag to "ln" unlinks an existing file of the link name;
in other words, it's already taken as "force".

It would be a mistake to issue a warning without some way to disable
it, akain to the "rm -f" behaviour of "-f".

One problem here is that it is likely that you waould want to *not*
get the "ln -f" behaviour, yet you would want to suppress warnings.

> Bottom line: Warnings are good program design.  Requiring extra work
> to issue them-- particularly when they're most frequently required in
> interactive use-- is not.

Clearly, you could wrap this with a script that uses test(1) to ensure
the link target exists, and put your script in your path ahead of the
ln command.

Whereas in order to get the existing non-"-f" behaviour, I'd have to
modify existing code.

Note that "-f" is already taken on "ln", according to POSIX semantics,
so it's not like you could overload it reasonably.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

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


help

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