delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/01/02/23:17:17

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1750C3851C17
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1609647392;
bh=boWicUO40RRaspxBbBRKZcLN7yZjLflLWGRMhZ6+Sws=;
h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=W8AvXQPj80+it6v1d8Ad2iF+QFXC5KC5pBbymrKtcNBn6elhIFNI0w0L+VSyJz5Sv
nl3K2PjxGxwTZ3Rhcr8et8cjVjMYnafcZsaM5OnkCvY05XRklYDXYW3bdeEoO3WkGL
EWOJKPJG2tu64emzZMVGA3iHxA6muG73y2ma89KQ=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B57013857004
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=PCD8RwKCi7Q+25gGtckszFwJf8TVq9jjUkpVueIP98U=;
b=kAj5OHBIQ10ZHVwSPsao1wXoS9hfWMnlJqRMiVgzS4276r5kTlPD7JygdO68rqL926
RJ/P0g7DOQTiPRvNe2+TBDxbCX5/nIWcA0Ism2FDuLB9iVtUe7ke5AnH/re3Jz+qZsQ9
+mmHRBihGFDw6fbo2rS8fvhV/n8N9VCzfwHuOaKvNBbVKvzKgGsFhJPqYjaX/n3HDm0J
A8ptKQ+yfmxcH96GKDOLfX76JkLDYhm6lDTl52I/QyGnc8JpmH6hcu4H+e/Hr9HlPtET
I5slzNV++cLYPoeEKQP0CKX3frt1NMGz6Ir6+Jd/+9gRe0E0n9fabAGhBw29gotfG3+3
X+0A==
X-Gm-Message-State: AOAM533hKscf8JjaE1B4l/zS+SwUn1iQUkxwxhf2QXqEhpRBrWO2Pm9f
xjQwGH/dS1e1MrhN1jIOoMnCU0yJaziCi+kTVbOMFaqsxVrjXQ==
X-Google-Smtp-Source: ABdhPJykhzXO2Db5O6c+ikXajlo1yXCrEzif2Y/iAiM3bPLVZnVoTipzaukUDCwgtCjN8V/wkGjqp48nQXvq7BhPyag=
X-Received: by 2002:a05:651c:1102:: with SMTP id
d2mr31272827ljo.398.1609647386108;
Sat, 02 Jan 2021 20:16:26 -0800 (PST)
MIME-Version: 1.0
Date: Sat, 2 Jan 2021 23:16:14 -0500
Message-ID: <CAC+X2=J-mKZH7WAdt2RQocqP+4rUqSkGi-acDC7U3N=uu7QGDA@mail.gmail.com>
Subject: Native symbolic link behavior is broken and makes backups using
Cygwin command line tools impossible
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: "Matt D. via Cygwin" <cygwin AT cygwin DOT com>
Reply-To: "Matt D." <codespunk AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

I have a folder with a lot of native Windows symbolic links. I want to
copy this folder.

I cannot rsync or cp this folder due to Cygwin being unable to create
symbolic links without also wanting to verify the link target. This
can be demonstrated:

$ ln -s a b
ln: failed to create symbolic link 'b': No such file or directory

If I create a test directory folder_a/ and folder_b/. Inside I will
"touch a" and "ln -s a b".

I cannot rsync this folder:

$ rsync -a folder_a/ folder_b/
rsync: symlink "folder_a/b" -> "a" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous
errors) (code 23) at main.c(1306) [sender=3.2.0dev]

Using "cp -a folder_a/* folder_b/" in this test case DOES work but
this is simply because files were returned in the correct order and
the link could be created.

This can be demonstrated where this works fine:

$ cp -a folder_a/a folder_a/b folder_b/

But this does not:

$ cp -a folder_a/b folder_a/b folder_b/
cp: cannot create symbolic link 'folder_b/b': No such file or directory
cp: warning: source file 'folder_a/b' specified more than once

The order in which files are returned while listing them in a
directory and necessitating their pre-existence while performing a
deep copy is impossible. It's also very normal for symbolic links to
exist which may or may not point to a valid target depending on the
observing path.

Windows does NOT require a link to be valid before creation. This can
be demonstrated with mklink:

C:\mklink b a
symbolic link created for b <<===>> a
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019