[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "readlink -f foo" fails if the target of foo does not exist

From: Dmitry V. Levin
Subject: Re: "readlink -f foo" fails if the target of foo does not exist
Date: Mon, 29 Mar 2004 01:33:32 +0400

On Sun, Mar 28, 2004 at 10:22:47AM +0100, J.D. Hood wrote:
> Dmitry V. Levin wrote:
> > You suggest to change "readlink -f" behaviour to more compatible way,
> > i.e. "readlink -f /path/to/foo" will also succeed when "/path/to"
> > exists and "/path/to/foo" points to some target "/another/path/to/bar"
> > where "/another/path/to" is a directory", right?
> Yes.
> > This change could be implemented using slightly modified version of the
> > canonicalize_file_name() function, which is IMHO more clean than Miquel's
> > implementation.
> If there is a better way of achieving the same end then I'm all for it.
> Are you suggesting that canonicalize_file_name() in the GNU C library
> be modified,

No.  Nobody knows how many programs rely upon current behaviour of this

> or are you suggesting that a variant of that function
> be included in readlink(1)?

Coreutils already includes canonicalize_file_name() implementation for
non-glibc platforms, so we can create new function and reuse this code.

I'd like to know how does current "readlink -f" work on Solaris where
resolvepath(2)-based implementation is used.

I'll submit necessary changes to the code and testsuit a bit later.


Attachment: pgpVopW57bQrP.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]