Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sat, 27 Mar 2004 13:07:17 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: lstat on FAT - Was: Problem with find on FAT drives Message-ID: <20040327180717.GA5383@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20040325023929 DOT GA335381 AT hpn5170x> <4060B627 DOT 8000400 AT scytek DOT de> <20040324155332 DOT GF17229 AT cygbert DOT vinschen DOT de> <4061E702 DOT 1040705 AT scytek DOT de> <20040324205644 DOT GA4580 AT redhat DOT com> <20040324213057 DOT GA296803 AT Worldnet> <20040324214239 DOT GA6079 AT redhat DOT com> <20040325023929 DOT GA335381 AT hpn5170x> <3 DOT 0 DOT 5 DOT 32 DOT 20040327120522 DOT 007febd0 AT incoming DOT verizon DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3.0.5.32.20040327120522.007febd0@incoming.verizon.net> User-Agent: Mutt/1.4.1i On Sat, Mar 27, 2004 at 12:05:22PM -0500, Pierre A. Humblet wrote: >At 03:03 PM 3/26/2004 -0500, Christopher Faylor wrote: >>[just to provide a non-flip answer to this subject] >>On Wed, Mar 24, 2004 at 09:39:29PM -0500, Pierre A. Humblet wrote: >>>On Wed, Mar 24, 2004 at 04:42:39PM -0500, Christopher Faylor wrote: >>>I wonder if >>> char *p = strrchr (src, '\0'); >>> /* Detect if the user was looking for a directory. We have to >strip the >>>should be inside the symlink loop or outside. I guess that depends if >>>symlink contents ending with / are special (on Sun the final / is >stripped in >>>symlinks, dunno about other Unix flavors). >> >>I really hated putting that in there to begin with (and it should be a >>'strchr' anyway) but it was required because Windows allows you to say >>/foo/bar/ and even /foo/bar/. even when bar isn't a directory. I don't >>believe that the code would work right if that wasn't there. It would >>allow a symlink to /foo/bar/. to work when it shouldn't. > >OK, but there are two other related issues: > >On Sun >1-everest$ ln -s /etc/passwd/ pw >1-everest$ tail -1 pw >+:x:::::/var/adm/local/nologinsh >1-everest$ ls -l pw >lrwxrwxrwx 1 humblet cm 11 Mar 27 17:49 pw -> /etc/passwd > (note the final / is gone) >On Cygwin: >~: ln -s /etc/passwd/ pw >~: tail -1 pw >tail: pw: No such device or address (because the test is in the symlink >loop) >~: ls -l pw >lrwxrwxrwx 1 pierre all 121 Mar 27 11:47 pw -> /etc/passwd/ The error here is that the error should be "Not a directory". That was broken by my new device handling code. I've checked in a fix. >On Cygwin: >~: ln -s /etc et >~: /bin/ls -ld et >lrwxrwxrwx 1 pierre all 106 Mar 27 11:54 et -> /etc >~: /bin/ls -ld et/ >drwxr-xr-x 11 pierre all 0 Oct 12 2001 et/ > Here they differ. > >Can someone check how Linux behaves in these cases? Cygwin mimics linux. I tried this on an another older UNIX system which mimics linux. Solaris and IRIX strip the trailing slash, however. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/