X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6757D386F81B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1609756612; bh=LnVPe4LwrlJ6T8U+jwL/1cUNf2LfZg9oSQyeKpO1Gds=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KyGY+HW1j1zE2Lyt7uC1w5RKJbxsJdgDpksFkxI8kFM83c3UfsTVdjO/i8FyhIy8J 8AXviNJ1SIj9NF8LqJ/gTco0TonWcJeSXDXxznd+bufrWNdd+XWWkKvgEZPkj2kIiZ 81DRCUKCxY+ECIebKKN1y/lImUpIMBU9R5V1pLac= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5CDAC3857C5F X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=rjNzO4pUfM0Z0JZtS2f40T7OFbYZ0I63AcVAfABPOgE=; b=fztDfaR3zjc20r0MEwWvDI6Um1Izx+ceoMMBRv/PEcqmJ3YnBz4dzX1SN2g1FjAi3z fHgORLLyErjyw4SaWBke/BE9AXhqGgtQL1VY7Tu1+qpE+pdY7x+l2a4CUgFiGLFPPZ1v 0j3ByKKzTyahprDLB2UIhUOWOK3AHPMysaTzjJhHM7veex2xAG2ek0iEwnab1IVigk+M Y04l3EtcKjuNWjfqn9hhsk9wG3A4Rgil8Sy3zWLt89vszcIhA87vlGWdV1eG9jwfZ6+F y9/co/n7AwZO1RXUzBinevX3feLiG/tWLYasfqL3fhvO14nhyfOTVvaS0QhjODLWcq9g /4hg== X-Gm-Message-State: AOAM5313xK6b8Thwf2G6g5emNX1ctJgiz3sq4JQXl6c2Ta1Jv5hmZLZF yYH9UxiinCZFo2cWelsIMam1/OkBxiszxyW/hlrxGt6gQkoY7w== X-Google-Smtp-Source: ABdhPJyClmtE9q+fA8gvwzKGbRec216FHhNH7DDrnInNtjAQ/UQ6fSEe9vDGNTFGMqzTnLT8TC/7Aj3TsHMxV1GcTZo= X-Received: by 2002:a2e:b889:: with SMTP id r9mr33320852ljp.44.1609756607840; Mon, 04 Jan 2021 02:36:47 -0800 (PST) MIME-Version: 1.0 References: <1d853aa0-4cbe-b92c-8d9f-53fc72371a7b AT SystematicSw DOT ab DOT ca> In-Reply-To: <1d853aa0-4cbe-b92c-8d9f-53fc72371a7b@SystematicSw.ab.ca> Date: Mon, 4 Jan 2021 05:36:35 -0500 Message-ID: Subject: Re: 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.8 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 List-Archive: List-Post: List-Help: List-Subscribe: , From: "Matt D. via Cygwin" Reply-To: "Matt D." Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" Did you try any of my test cases? This can't and doesn't work for the reasons I outlined in my previous message: $ cp -av folder_a/a folder_b/ 'folder_a/a' -> 'folder_b/a' cp: cannot create symbolic link 'folder_b/a': No such file or directory $ cp -dv folder_a/a folder_b/ 'folder_a/a' -> 'folder_b/a' cp: cannot create symbolic link 'folder_b/a': No such file or directory $ cp -Pv folder_a/a folder_b/ 'folder_a/a' -> 'folder_b/a' cp: cannot create symbolic link 'folder_b/a': No such file or directory On Sun, Jan 3, 2021 at 12:00 AM Brian Inglis wrote: > > On 2021-01-02 21:16, Matt D. via Cygwin wrote: > > 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 > > Depending on exactly what you have and what you want to do try: > > $ cp -av > $ cp -dv > $ cp -Pv > or > > robocopy /sl > > -- > Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada > > This email may be disturbing to some readers as it contains > too much technical detail. Reader discretion is advised. > [Data in binary units and prefixes, physical quantities in SI.] > -- > 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 -- 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