From owner-freebsd-current Wed May 10 04:20:10 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id EAA17395 for current-outgoing; Wed, 10 May 1995 04:20:10 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id EAA17381 for ; Wed, 10 May 1995 04:19:47 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id VAA09329 for current@freebsd.org; Wed, 10 May 1995 21:18:35 +1000 Date: Wed, 10 May 1995 21:18:35 +1000 From: Bruce Evans Message-Id: <199505101118.VAA09329@godzilla.zeta.org.au> To: current@FreeBSD.org Subject: cp removes target file Sender: current-owner@FreeBSD.org Precedence: bulk `cp foo bar' removes the target file if there is an error. The relevant Errors may occur during the following operations: mmap errors for mapping the source short writes mmap errors for unmapping the source write errors read errors (if mmapping is not being used) Errors are rare. I've only seen them for: disk full hangup on the target when the target is a tty. Removing the target when the target is a special file is certainly a bug. I think removing the target is a bug in all cases. Removing it removes its attributes as well as its contents. Removing it doesn't help unfill the disk if the target is linked. Removing it may destroy unreplaceable data if the source is not a regular file. Gnu cp doesn't seem to remove the target. Bruce