delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/04/29/08:16:08

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:references:in-reply-to:subject:date
:message-id:mime-version:content-type:content-transfer-encoding;
q=dns; s=default; b=KR99NE+CtDH0LQVysN+7uJBsUvZlOGR1Z56ArJ8e/Ew
DOm9N5cFdRdNzkE/08iMCGamAMYXQVcBnguRNkc57onrh6qU3ZPcTcdS9WF8X0BV
vbykNHhoxZLZvPXHcRg+QS1sAVp6EZFj8fnjcqHJbP9NCNXSOGfa6bzgTK+OSTEw
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:references:in-reply-to:subject:date
:message-id:mime-version:content-type:content-transfer-encoding;
s=default; bh=6aXD80ZdanKh4Sw0Nn0tiM7qqdQ=; b=EMmehbKC+JahRYGOv
ZbnvB07wa3vyLe6U3lsN0iSAM4dPL+0MVvoLGPuB2zE3o6E3/97ov7KKOd3/YFq8
NtmUephUTlcAZgnIDZ5E+qenMESHdOD/un2nUSfwwuu2Db5K5l5gTj9p1YZsEJV3
B2rdgLgg1avp49SEl7o4S3Sv5Q=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.4 required=5.0 tests=BAYES_50,KAM_ASCII_DIVIDERS,KAM_INFOUSMEBIZ,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*F:D*us, HX-MimeOLE:V6.1.7601.17609, Consultant, system32
X-HELO: mail.pdinc.us
From: "Jason Pyeron" <jpyeron AT pdinc DOT us>
To: <cygwin AT cygwin DOT com>
References: <CAPTiy3NUXprQL6V0+Njc2L7XfhpqtC7oWFwNMhOEFZ2OZmddoQ AT mail DOT gmail DOT com> <1606116423 DOT 20160429020650 AT yandex DOT ru> <CAPTiy3OhkvWhGKCisnoLBFZqTL1_Rcq4-vdn0U8Qfnxk+WsX-A AT mail DOT gmail DOT com> <5580e7fc-e227-d9d8-a186-b58c8b17cfa3 AT lysator DOT liu DOT se>
In-Reply-To: <5580e7fc-e227-d9d8-a186-b58c8b17cfa3@lysator.liu.se>
Subject: RE: [cygwin] Re: `CYGWIN=winsymlinks:nativestrict`, `ln -s target link` fails if target doesn't exist
Date: Fri, 29 Apr 2016 08:15:57 -0400
Message-ID: <C0C0565790DF4779873615FEE70B2765@black7>
MIME-Version: 1.0
X-IsSubscribed: yes

> -----Original Message-----
> From: Peter Rosin
> Sent: Friday, April 29, 2016 8:03 AM
> 
> On 2016-04-29 13:34, Gene Pavlovsky wrote:
> >>> POSIX says a symlink to a missing target is perfectly 
> well-defined 
> >>> (you can't stat() through it, but you can readlink() it). But 
> >>> Windows native symlinks can't do that.  So the problems you are 
> >>> encountering all stem from the fact that you are trying 
> to make Windows do something it can't.
> >>
> >> My initial reaction was that, too, but I tried mklink (CMD 
> internal 
> >> command)
> >>
> >>> mklink x y
> >>
> >> and it created the symlink in the empty directory just fine.
> > 
> > This is my point exactly. Windows dangling symlinks can be 
> created as 
> > easily as in UNIX.
> > At least this is the case on my Win7 x64.
> 
> No, it can't.
> 
> c:\>mklink a b
> c:\>mkdir b
> c:\>cd b
> c:\b>cd ..
> c:\>cd a
> The directory name is invalid
> c:\>rmdir b
> c:\>echo hello > b
> c:\>type a
> hello
> 
> It only works for dangling links to files. Not good enough.

To be more precise, you must choose file or dir symlinks at cretion time:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cd C:\cygwin\tmp\winlinktest\dirs

C:\cygwin\tmp\winlinktest\dirs>mklink /D a b
symbolic link created for a <<===>> b

C:\cygwin\tmp\winlinktest\dirs>mkdir b

C:\cygwin\tmp\winlinktest\dirs>cd b

C:\cygwin\tmp\winlinktest\dirs\b>cd ..

C:\cygwin\tmp\winlinktest\dirs>cd a

C:\cygwin\tmp\winlinktest\dirs\a>cd ..

C:\cygwin\tmp\winlinktest\dirs>rmdir b

C:\cygwin\tmp\winlinktest\dirs>echo hello > b

C:\cygwin\tmp\winlinktest\dirs>type a
Access is denied.

C:\cygwin\tmp\winlinktest\dirs>del b

C:\cygwin\tmp\winlinktest\dirs>mkdir b

C:\cygwin\tmp\winlinktest\dirs>cd a

C:\cygwin\tmp\winlinktest\dirs\a>

Jason Pyeron

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 



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