delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/03/11:30:00

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33
X-Spam-Check-By: sourceware.org
Date: Thu, 03 Sep 2009 11:29:30 -0400
From: "cygwin at sipxx.com" <cygwin AT sipxx DOT com>
Subject: Re: problems with symbolic links
In-reply-to: <617861.50861.qm@web24204.mail.ird.yahoo.com>
To: cygwin AT cygwin DOT com
Message-id: <4A9FE0DA.20304@sipxx.com>
MIME-version: 1.0
References: <617861 DOT 50861 DOT qm AT web24204 DOT mail DOT ird DOT yahoo DOT com>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

This is actually an old known problem that exists with older versions of 
samba, I know that this works correctly at least since samba 3.0.23d, 
and I know that, for example, samba 3.0.2 does not. This is still true 
for cygwin 1.7 which uses a file attribute, rather than the .lnk extension.



alf salte wrote:
> My setup:
>
> I have a network drive seen in windows as S: and has file type NTFS. Actually, the file system is ext3 but it seems the software on the network drive makes it appear as NTFS to windows - properties in windows describe it as NTFS.
>
> In cygwin this is seen as /cygdrive/s and when I try to create a symbolic link on the drive it appears to be working correctly:
>
> ln -s foo bar
>
> creates a symbolic link bar.lnk that contains a reference to the file foo.
>
> The problem is when I try to use this symbolic link. For one thing, scripts that then try to open bar get a surprise since the filename is really bar.lnk but worse is the fact that neither bar nor bar.lnk opens up foo. less bar just report file not found and less bar.lnk simply opens the link and dumps out the binary data in it where one of the fields contain the file foo.
>
> What am I doing wrong? I did see that there was some problem if you did not have the drive mounted as "system" but the drive /cygdrive/s is mounted as (remote,system) so I am at a loss as to what is wrong.
>
> Would appreciate any help in the matter. As it is, any installation script or make script that make a link "ln -s foo.c bar.c" will not be able to use 'bar.c' to refer to the file and gcc does not understand that bar.c.lnk is supposed to be a C source file - nor is it a C source file since it is a link etc etc. Also, ls -l does not report the file as 'l' in the first character, it reports the link as a regular file. Is there a bug in fstat()?
>
> I would guess that open("foo",..) should check if the file "foo" is not found, if there is a file "foo.lnk" and then open that file and find the file it references etc.  Not sure exactly how or where this is handled in the code. Checking cygwin.dll source code there is a path name resolver class and it does appear to add a ".lnk" extension but it appears to only apply to directory names in a path and not sure exactly under which conditions that code is enabled from a regular open() function.
>
> Alf
>
>
>
>       _________________________________________________________
> Alt i ett. Få Yahoo! Mail med adressekartotek, kalender og
> notisblokk. http://no.mail.yahoo.com
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>
>   


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019