X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Fri, 16 Dec 2011 13:45:07 -0500 Message-ID: Subject: cp: skipping file `...', as it was replaced while being copied From: Raul Miller To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I am currently being frustrated by cp's current feature set. Specifically, I am getting $ cp -rf directory1 directory2 cp: skipping file `...', as it was replaced while being copied cp: skipping file `...', as it was replaced while being copied cp: skipping file `...', as it was replaced while being copied cp: skipping file `...', as it was replaced while being copied cp: skipping file `...', as it was replaced while being copied cp: skipping file `...', as it was replaced while being copied ... messages, and cp is not copying files for me. So, first off... ok, this is a feature which I am sure is useful for some people. But I feel that it should be an option. If I am copying a snapshot of a rapidly changing directory, grabbing a copy of a file that's being changed could be exactly what I want, and the burden is on me to deal with the result. Alternatively, in this case, the content is not being changed at all (which would be evident if cp ran through the file twice performing an md5sum on the file during the copy and again after the file copy had been made). And note also that timestamps can be changed by touch without changing the contents of the file (but touch does not seem to induce this behavior). And note also that on a real unix system, when you have opened an inode, the name which you used to find that inode can change (or be eliminated), and that's not a valid reason to not copy the file -- you still have access to the original data as long as you retain the original file handle. And I am sure similar reasoning applies to any other information that might be yielded by stat. I do not mind cp exiting with a non-zero return code, but refusing to copy a file that I specifically asked it to copy? If I wanted to not copy a file, I could use /bin/true instead of /bin/cp ... Second, I am using an up-to-date instance of cygwin, and this is happening to me on a networked file system (which I do not administer). Finally, personally, I would prefer to not have to mount anything. I currently do not have to mount the file system (I use symlinks), and it seems wrong to have go and deal with mounts, to work around a feature which has cp doing something other than copying files. That said, here's what getVolInfo says about a couple file systems which have this issue: $ /usr/lib/csih/getVolInfo /h/. Device Type : 7 Characteristics : 10 Volume Name : Serial Number : 2684354636 Max Filenamelength : 255 Filesystemname : Flags : 4000e FILE_CASE_SENSITIVE_SEARCH : FALSE FILE_CASE_PRESERVED_NAMES : TRUE FILE_UNICODE_ON_DISK : TRUE FILE_PERSISTENT_ACLS : TRUE FILE_FILE_COMPRESSION : FALSE FILE_VOLUME_QUOTAS : FALSE FILE_SUPPORTS_SPARSE_FILES : FALSE FILE_SUPPORTS_REPARSE_POINTS: FALSE FILE_SUPPORTS_REMOTE_STORAGE: FALSE FILE_VOLUME_IS_COMPRESSED : FALSE FILE_SUPPORTS_OBJECT_IDS : FALSE FILE_SUPPORTS_ENCRYPTION : FALSE FILE_NAMED_STREAMS : TRUE FILE_READ_ONLY_VOLUME : FALSE FILE_SEQUENTIAL_WRITE_ONCE : FALSE FILE_SUPPORTS_TRANSACTIONS : FALSE $ /usr/lib/csih/getVolInfo /p/. Device Type : 7 Characteristics : 10 Volume Name : Serial Number : 1084808073 Max Filenamelength : 255 Filesystemname : Flags : 700ff FILE_CASE_SENSITIVE_SEARCH : TRUE FILE_CASE_PRESERVED_NAMES : TRUE FILE_UNICODE_ON_DISK : TRUE FILE_PERSISTENT_ACLS : TRUE FILE_FILE_COMPRESSION : TRUE FILE_VOLUME_QUOTAS : TRUE FILE_SUPPORTS_SPARSE_FILES : TRUE FILE_SUPPORTS_REPARSE_POINTS: TRUE FILE_SUPPORTS_REMOTE_STORAGE: FALSE FILE_VOLUME_IS_COMPRESSED : FALSE FILE_SUPPORTS_OBJECT_IDS : TRUE FILE_SUPPORTS_ENCRYPTION : TRUE FILE_NAMED_STREAMS : TRUE FILE_READ_ONLY_VOLUME : FALSE FILE_SEQUENTIAL_WRITE_ONCE : FALSE FILE_SUPPORTS_TRANSACTIONS : FALSE -- Raul -- 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