This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
ls .. not respecting symbolic links
- From: "Robb, Sam" <sam dot robb at timesys dot com>
- To: <cygwin at cygwin dot com>
- Date: Tue, 10 Dec 2002 11:29:52 -0500
- Subject: ls .. not respecting symbolic links
All,
My apologies if this is a report of expected behavior. I'm
primarily a Windows user, and despite spending the last year
in Linux/Cygwin lands, I'm still very new to some things :-/
Create a symlink to a directory:
$ cd /tmp
$ ls
$ ln -s /cygdrive/c/TEMP c_temp
$ cd c_temp
At this point, I'd expect "ls .." to give me a listing of /tmp.
Instead, I get a listing for /cygdrive/c:
$ ls -la ..
total 733
-rwxr-xr-x 1 sam.robb unknown 0 Sep 7 2001 AUTOEXEC.BAT
-rw-r--r-- 1 sam.robb unknown 0 Sep 7 2001 CONFIG.SYS
(etc)
Similarly, "find .. -maxdepth 1" gives:
$ find .. -maxdepth 1
..
../AUTOEXEC.BAT
../boot.ini
../CONFIG.SYS
(etc)
On the other hand, using "ls $PWD/.." gives the contents of /tmp,
as does "find $PWD/.. -maxdepth 1":
$ ls -la $PWD/..
total 4
drwxr-xr-x 2 sam.robb unknown 0 Dec 10 11:01 .
drwxr-xr-x 15 sam.robb unknown 4096 Dec 4 16:30 ..
lrwxrwxrwx 1 sam.robb unknown 103 Dec 10 11:01 c_temp -> /cygdrive/c/TEMP
$ find $PWD/.. -maxdepth 1
/tmp/c_temp/..
/tmp/c_temp/../c_temp
I see the same behavior under Linux, so the question is:
is this a bash bug, or expected behavior?
-Samrobb
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/