public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Using cp converts windows junctions to a cywin symlink
Date: Tue, 03 Nov 2015 13:20:00 -0000	[thread overview]
Message-ID: <20151103132052.GG18567@calimero.vinschen.de> (raw)
In-Reply-To: <CAP_kE8XU_sr2wrfvFQ1o8NrKrWvOZwU02+2CZbtkgtDD9H9R7A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

On Nov  2 13:57, Adrian H wrote:
> I was copying a directory of files, some of which were windows junctions.
> These got converted to a cygwin symlink.  Although I am impressed that there
> are such a thing for those OSs/drives that do not support such things, for those
> that do, I think it would be good to keep the copy a junction.  Otherwise,
> things can get messy.
> 
> Can this be corrected?

No.  The actual copy is done by the application, not by Cygwin.  The
application (cp, rsync, whatnot) is a POSIX application which has no
notion of "junctions".  From the view of the POSIX application,
directory junctions are symlinks.  So the copying application will call
the symlink or symlinkat function.  This call has no idea that the
to-be-created symlink is a copy of a directory juntion.  After all,
there 's no connection between the stat call on the source and the
symlink call on the destination.

To alleviate this partially, you can copy with the environment variable
CYGWIN set to "winsymlinks:native" or "winsymlinks:nativestrict".  This
will create native symlinks, not directory junctions, so it requires the
"Create symbolic links" privilege set for the current user, but it's
better than nothing.  From a consumer perspective, a directory junction
and a symlink to a directory are not really different.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2015-11-03 13:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-02 18:57 Adrian H
2015-11-02 20:05 ` Andrey Repin
2015-11-02 23:32   ` Using cp converts windows junctions to a cywin symlink; a security-config override Linda Walsh
2015-11-02 23:50     ` Andrey Repin
2015-11-03 13:20 ` Corinna Vinschen [this message]

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=20151103132052.GG18567@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --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).