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: J.D. Hood
Subject: Re: "readlink -f foo" fails if the target of foo does not exist
Date: Sun, 28 Mar 2004 10:22:47 +0100 (BST)

Dmitry V. Levin wrote:
> [...] due to difference between realpath(3) implementations in BSD
> and glibc, result of readlink -f differs in certain circumstances.
 
Your examples show that the old readlink implementation was insane.


> When prepared readlink utility for coreutils (August, 2002), I've
> decided to simplify the canonicalize mode by using
> canonicalize_file_name() which succeeds only when given path exists.
 
I don't dispute that that was an improvement over the old program.


> 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, or are you suggesting that a variant of that function
be included in readlink(1)?

--
Thomas

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html




reply via email to

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