coreutils
[Top][All Lists]
Advanced

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

Re: Extend readlink -e


From: Eric Blake
Subject: Re: Extend readlink -e
Date: Fri, 04 Nov 2011 11:11:17 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15

please keep the list in the loop

On 11/04/2011 10:42 AM, Peng Yu wrote:
I'm not sure I follow what you are asking for, then.


I understand -f does what I need. I was saying that this fact is not clear
just by reading the manual. I'm suggesting to reword the manual to
something like this.

        -f, --canonicalize
               canonicalize by following every symlink in every component of
the given name recursively; all but the last component must exist. If the
argument is a real file or path, then the abspath of the argument is
returned.

The current wording in the manual (that is, the info pages) is:

`Canonicalize mode'
     `readlink' outputs the absolute name of the given file which
     contains no `.', `..' components nor any repeated separators (`/')
     or symbolic links.

`-f'
`--canonicalize'
     Activate canonicalize mode.  If any component of the file name
     except the last one is missing or unavailable, `readlink' produces
     no output and exits with a nonzero exit code.  A trailing slash is
     ignored.

The information in 'readlink --help' (which also appears in 'man readlink') is intentionally shorter, but still gets across the difference in the three canonicalization modes:

  -f, --canonicalize            canonicalize by following every symlink in
every component of the given name recursively;
                                all but the last component must exist
  -e, --canonicalize-existing   canonicalize by following every symlink in
every component of the given name recursively,
                                all components must exist
  -m, --canonicalize-missing    canonicalize by following every symlink in
every component of the given name recursively, without requirements on components existence



I hope that it is now clear to you what I mean.

I'm not quite sure I see what you are asking to be changed. It appears that you are complaining that the --help output doesn't mention anything about the canonicalization always producing an absolute name, unless part of the resolution process fails, and that the difference between the three canonicalization modes is how much of the user input name must already exist before considering resolution as failed.

At this point, patches might speak louder than words. You are welcome to submit a patch against readlink.c that improves the --help wording, or against coreutils.texi to improve the info wording; remember that it is intentionally a goal of the --help output to be concise, while the info documentation should be complete.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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