Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 1995 21:18:35 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        current@FreeBSD.org
Subject:   cp removes target file
Message-ID:  <199505101118.VAA09329@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
`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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505101118.VAA09329>