delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/08/01/17:14:48

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 1 Aug 2002 17:14:31 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: bug: hard links to soft links do not work
In-Reply-To: <5.1.0.14.2.20020801123520.01f97010@pop3.cris.com>
Message-ID: <Pine.GSO.4.44.0208011711550.3395-100000@slinky.cs.nyu.edu>
MIME-Version: 1.0

On Thu, 1 Aug 2002, Randall R Schulz wrote:

> My hunch is that a patch gratefully accepted for this situation would be an
> addition to the "ln" command that detected when the target was a Windows
> shortcut-based Cygwin symlink and in that case supplied the ".lnk"
> extension if it was not already present in the specified new link name.

Just a minor comment - a ".lnk" should actually be added to the new link
name even if it is present (i.e., "aaa.lnk" should become "aaa.lnk.lnk"),
as the intent would be that the ".lnk" would be part of the visible name,
and if the file becomes a symbolic link, the ".lnk" would be lost.
It's not even 2c, it's <1c, but why not?.. ;-)
	Igor

On Thu, 1 Aug 2002, Randall R Schulz wrote:

> Sam,
>
> The hard link to the symlink is made somewhat "blindly" in that the ".lnk"
> suffix that indicates that the link target is itself a symlink is not
> automatically added to the newly created hard link. Since the
> interpretation of a file's contents as a symbolic link is not based on any
> content signature (such as, say, a magic number) but rather only by the
> extension, a hard link without the ".lnk" (or, equivalently, a shortcut
> file renamed to omit the ".lnk" extension) will not be interpreted as a
> symbolic link.
>
> Thus the binary junk you saw was the shortcut / symlink contents themselves.
>
> At the end of the series of commands you gave (using an NTFS file system,
> of course), this is the result (note the "inode" numbers in the left column):
>
> % ll -i foo 1 2 3
> 6537940 -rw-rw-r--    2 RSchulz  None            4 Aug  1 12:34 1
> 10863326 lrwxrwxrwx    2 RSchulz  None           82 Aug  1 12:34 2 -> 1
> 10863326 -r-xr-xr-x    2 RSchulz  None           82 Aug  1 12:34 3*
> 6537940 -rw-rw-r--    2 RSchulz  None            4 Aug  1 12:34 foo
>
> My hunch is that a patch gratefully accepted for this situation would be an
> addition to the "ln" command that detected when the target was a Windows
> shortcut-based Cygwin symlink and in that case supplied the ".lnk"
> extension if it was not already present in the specified new link name.
>
> Randal Schulz
> Mountain View, CA USA
>
>
> At 11:19 2002-08-01, Sam Steingold wrote:
> >cygwin does not handle hard and soft links together:
> >
> >$ echo "foo" > foo
> >$ ln foo 1
> >$ cat 1
> >foo                             ; GOOD!
> >$ ln -s 1 2
> >$ cat 2
> >foo                             ; GOOD!
> >$ ln 2 3
> >$ cat 3
> ><some binary data instead of "foo">
> >$
> >
> >I.e., hard links to soft links do not work.
> >
> >--
> >Sam Steingold
>
>
> --
> 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/
>
>

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file


--
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/

- Raw text -


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