bug-coreutils
[Top][All Lists]
Advanced

[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: Thomas Hood
Subject: Re: "readlink -f foo" fails if the target of foo does not exist
Date: Mon, 22 Mar 2004 18:53:22 +0100

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.

The program is still in development but only minor changes 
should be needed.  The license is LGPL.

How might the new program be submitted for including in coreutils?
--
Thomas Hood







reply via email to

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