X-Recipient: archive-cygwin@delorie.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:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; q=dns; s=
	default; b=HbCWkPT0/gfSvOZcjIsAllkcNrlHI8NeM8v5QbRfDxK15YkuEPptJ
	mZuERVw2JGp5R4VIobUX4Kwj8kFtURNIv2mdYE0VgXwiD+muyVtYiW9JjDZ7kUa4
	7o09Lsez/xWGTbOq3+x9mn38o4/KzUu2HHldCVUvxQ7NqLrFqN2eoc=
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:date:from:to:subject:message-id:reply-to
	:references:mime-version:content-type:in-reply-to; s=default;
	 bh=HTPtZXNtRc9h6cR9xLUmcltPyj4=; b=DxtC+ruwo2T2EjSyV8BfiGr69FE0
	+kGNxjqrYqzZqvyIi1ijbkvXkIJoiGGGvraCRmqoaLEnJzKXFFPuOUQg+oDk/WVZ
	7rY6c5V6JK2+qDOWnYCH/lW4OOcWjuTEgeU0yeAeCE1QSwQdozApHR1GjzMJn4Fs
	cn/T4pWx99cbnMQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2
X-HELO: calimero.vinschen.de
Date: Tue, 3 Nov 2015 14:20:52 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Using cp converts windows junctions to a cywin symlink
Message-ID: <20151103132052.GG18567@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <CAP_kE8XU_sr2wrfvFQ1o8NrKrWvOZwU02+2CZbtkgtDD9H9R7A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;	protocol="application/pgp-signature"; boundary="/Zw+/jwnNHcBRYYu"
Content-Disposition: inline
In-Reply-To: <CAP_kE8XU_sr2wrfvFQ1o8NrKrWvOZwU02+2CZbtkgtDD9H9R7A@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)

--/Zw+/jwnNHcBRYYu
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 th=
ere
> are such a thing for those OSs/drives that do not support such things, fo=
r those
> that do, I think it would be good to keep the copy a junction.  Otherwise,
> things can get messy.
>=20
> 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

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

--/Zw+/jwnNHcBRYYu
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWOLS0AAoJEPU2Bp2uRE+ger4QAIz9U7dlPX7rkbo+gY4P1Kot
78CeRK58Yz+Q8n56SKqns53oCIlBTl2xZfB1jbN4ZMT7irBZWoZ+3RB0MCmjgW8i
fdXr7VtSg6GkCdP7sWAGYY5UOxAJngmcG52dBNlk3O/1H7KwnhfsTBUC5LuexLYE
kGFMUv4m28WgbdjGWUuNEIBjUbK0tXepXviY7O0vN+6jxwzOiFIWlyioCS6eJPHv
m1kim9vizKmWnQp7dWHlLP8C8omkwmwW/s9+vRwxQsBVtBWVx30OuIF6C1BznlLC
dBLKcGas5rhnKJ1VOzOQBk5wOeKP4QEkla1BkyPqDFWDdDB/Tq1wyq84584Sx/qx
Lk9ccEqYjRz7QwpsnU947ePfUnkTXqzSljM5psCmUC7yPqUk2YNYY/dvga2Bmf5H
xNln+CVB0HTENWCBHd1xkzRCboujxD6ulmZvTIfYABJCk3Rd7tZy1R8q3s6DV3Yv
iL9fZqoFyjWQ72/RGPHwXIUsCGJehrjUIB09jSSHPJXRKcYeXsD/Lfgb1iGEVxou
PlXqyopko44MEFqm3gJTdp1BpBxoaGefLMi0r2QUV+4otKFVRxDR+mqlByPQ/2mu
HAPa7I2fgvm0unwwuK/MIWiYvopTLWOwWVdQet15uBQmDHLXUBH4nDjj41rqBV7R
uVZeB6TAZzG6HXwDEE82
=sznM
-----END PGP SIGNATURE-----

--/Zw+/jwnNHcBRYYu--
