delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/06/03/06:24:57

From: cgf AT cygnus DOT com (Christopher Faylor)
Subject: RE: Path converting fix.
3 Jun 1998 06:24:57 -0700 :
Message-ID: <199806031255.IAA09864.cygnus.cygwin32.developers@kramden.cygnus.com>
To: cygwin32-developers AT cygnus DOT com, noer AT cygnus DOT com, sos AT prospect DOT com DOT ru

>From: Sergey Okhapkin <sos AT prospect DOT com DOT ru>
>Date: Wed, 3 Jun 1998 14:49:34 +0400
>
>Geoffrey Noer wrote:
>> > path.cc	(conv_to_win32_path, conv_to_full_win32_path): resolve
>> > symlinks before converting.
>>
>> I don't understand why it needs to be done at this point.  Say we have
>> /foo/symbar that points to /foo/bar.  If we convert /foo/symbar to
>> Win32, shouldn't we have C:/foo/symbar after the conversion?
>
>No! This calls are provided by cygwin.dll to convert unix-like pathnames to 
>a pathnames suitable to pass to win32 calls. If the path is a symlink, the 
>real filename (the symlink points to) should be returned.
>
>> As long as the path is handed back to a Cygwin32 function, the symlink
>> would get discovered eventually, right?
>
>The return value of this calls is not supposed to be used in a cygwin 
>calls!
>
>> What's the correct solution?
>>
>
>To apply my patch :-)

Sergey's patch looks right to me.  I noticed this behavior when I
was first porting perl.

Of course there is an alternative now:

conv_to_win32_path (realpath(path), char *win32_path);

The only advantage I can see to this is that it allows a windows
program to manipulate a "symbolic link" file.

This is what I did in perl, btw.

cgf

- Raw text -


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