From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109695 invoked by alias); 21 Apr 2019 12:20:49 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 109685 invoked by uid 89); 21 Apr 2019 12:20:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_20,SPF_PASS autolearn=ham version=3.3.1 spammy=symbolic, sk:chicken, headache, H*UA:WOW64 X-HELO: mailsrv.cs.umass.edu Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 21 Apr 2019 12:20:47 +0000 Received: from [192.168.0.12] (c-24-62-203-86.hsd1.ma.comcast.net [24.62.203.86]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id D18804023B8D; Sun, 21 Apr 2019 08:20:45 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: Copying of symbolic links not working as expected To: cygwin@cygwin.com References: From: Eliot Moss Message-ID: <2e4aeaad-10d5-73ee-c49f-797945261b36@cs.umass.edu> Date: Sun, 21 Apr 2019 12:20:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00145.txt.bz2 On 4/21/2019 7:45 AM, Matt D. wrote: > Note that this creates a chicken-and-the-egg problem when copying paths which contain symbolic links > which will be but are not yet valid at the time of copying. > > For example, copying a very large and complex tree with many lots of links will result in a broken > copy. I'm trying to copy a directory tree right now and it's a major headache. Dear Matt - My reading of the cp man page suggests that the -d flag addresses this issue for cp. Now tar has these flags available: -h (--dereference) to follow sym links, and --hard-dereference to follow hard links This suggests that tar does not normally follow links. So I am less certain what is happening there. Another program you might consider is rsync. While I normally think of it as being for efficient cross-network copying, it works within a system as well. It will pay to read through about its flags before trying to use it for this purpose. It is true that, compared with Linux, Cygwin symlinks are slightly funky in that they are true files in the Windows file system, but with a specific format that Cygwin recognizes as special but Windows does not. But that should not generally be noticeable when using generic Cygwin versions of programs such as these. Regards - Eliot Moss -- 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