[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, 22 Mar 2004 22:48:21 +0300 |
On Mon, Mar 22, 2004 at 06:53:22PM +0100, Thomas Hood wrote:
> Since I raised this issue in January 2004 there has been a
> positive development. Miquel van Smoorenburg has written a new
> readlink program. Currently the program is included in the
> initscripts package and is solely for the use of
> sysvinit/sysv-rc/initscripts in Debian. However, the intent
> is to develop a program that can replace the one in coreutils and
> which meets the criteria we discussed earlier.
>
> This program does not use the glibc realpath() function. The
> latter function, contrary to its description in stdlib.h, does
> not return the canonical path of any nonexistent.
>
> Miquel's program works like the current readlink program except
> in how it deals with a symlink chain to a nonexistent.
>
> If, while canonicalizing the symlink chain, readlink arrives at
> a pathname whose target doesn't exist but the parent directory
> of whose target does exist then "readlink -f" and "readlink -ff"
> print the pathname.
>
> If, while canonicalizing the symlink chain, readlink arrives at
> a pathname whose target and the parent of whose target do not
> exist then "readlink -f" fails whereas "readlink -ff" prints the
> pathname.
I'd suggest to leave current "readlink -f" behaviour unchanged.
If you need to add new mode for readlink(1), please consider adding
new option.
--
ldv
pgpdh_XEHip16.pgp
Description: PGP signature