bug-coreutils
[Top][All Lists]
Advanced

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

Re: ls: add a switch not to strip the directory we gave


From: Paul Jarc
Subject: Re: ls: add a switch not to strip the directory we gave
Date: Tue, 13 May 2003 13:36:09 -0400
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Jim Meyering <address@hidden> wrote:
> Did you use the name of an existing directory?

$ cd ~
$ mkdir -p foo/bar
$ ls -t ~/foo | sed q
bar
$ readlink -f `ls -t ~/foo | sed q`; echo $?
1

> If so, I'll bet you're using coreutils-5.0 on a Solaris system.

$ uname -srmo
Linux 2.4.20 i686 GNU/Linux
$ readlink --version
readlink (coreutils) 5.0
Written by Dmitry V. Levin.

Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

>> readlink sees only the basename of a file in some directory other
>> than the current directory, so I don't think it can possibly
>> construct the full path.
>
> Of course it can, modulo bugs, and permissions.

No.  In the example above (equivalent to the one you gave), readlink
sees only "bar", which exists somewhere, but not in the current
working directory.  There's no way for readlink to guess how the name
"bar" was constructed.  So this won't work for Dan.


paul




reply via email to

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