public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Paul Townsend <aab@purdue.edu>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Cc: Paul Townsend <aab@purdue.edu>
Subject: Semantic difference with/without CYGWIN=winsymlinks:nativestrict
Date: Thu, 06 Sep 2018 08:52:00 -0000	[thread overview]
Message-ID: <MWHPR22MB0288A164791C41C488307F23C1010@MWHPR22MB0288.namprd22.prod.outlook.com> (raw)


Attempts to make symlinks are handled differently depending on (1) whether or not the target file pre-exists and (2) whether or not CYGWIN=winsymlinks:nativestrict is exported.  Actually,  'ln' seems to require the pre-existence as if it were a hard link attempt when CYGWIN is defined.  FWIW -  'ln' on Ubuntu 18.04 on WSL (Windows Subsystem for Linux) allows the target to be nonexistent.

The following is a very simplistic example:


 $ unset CYGWIN

 $ rm a b

 $ ln -s a b

 $ ls -l a b

 ls: cannot access 'a': No such file or directory
 lrwxrwxrwx 1 aab None 1 Sep  6 03:45 b -> a       <=<=< not a "real" Windows type symlink
 $ export CYGWIN=winsymlinks:nativestrict
 $ rm a b
 $ ln -s a b
 ln: failed to create symbolic link 'b': No such file or directory
 $ rm a b
 rm: cannot remove 'a': No such file or directory
 rm: cannot remove 'b': No such file or directory
 $ touch a
 $ ln -s a b
 $ ls -l a b
-rw-r--r-- 1 aab None 0 Sep  6 03:55 a
lrwxrwxrwx 1 aab None 1 Sep  6 03:55 b -> a
 $ rm a b

Found above when I downloaded the source for 'bash-4.4' and 'cygport'/'tar' attempted to make the symlink
    bash-4.4/ChangeLog -> [bash-4.4/]CWRU/changelog
which did not yet exist.  The error message is a bit confusing but it implies that the destination must pre-exist in order for the symlink to be made.  FWIW - With CYGWIN exported as shown above, 'ln' does create real symlinks as verfied by Windows 10 File Explorer.

--    Thanks



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

                 reply	other threads:[~2018-09-06  8:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR22MB0288A164791C41C488307F23C1010@MWHPR22MB0288.namprd22.prod.outlook.com \
    --to=aab@purdue.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).