From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31649 invoked by alias); 29 Apr 2016 12:15:50 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 31631 invoked by uid 89); 29 Apr 2016 12:15:50 -0000 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 Received: from mail.pdinc.us (HELO mail.pdinc.us) (67.90.184.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 29 Apr 2016 12:15:39 +0000 Received: from black7 (nsa1.pdinc.us [67.90.184.2]) (authenticated bits=0) by mail.pdinc.us (8.14.4/8.14.4) with ESMTP id u3TCFauZ015461 for ; Fri, 29 Apr 2016 08:15:37 -0400 From: "Jason Pyeron" To: References: <1606116423.20160429020650@yandex.ru> <5580e7fc-e227-d9d8-a186-b58c8b17cfa3@lysator.liu.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 12:20:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00644.txt.bz2 > -----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