(copy_reg): New parameters: X and NEW_DST.
authorJim Meyering <jim@meyering.net>
Sun, 27 Aug 2000 09:30:00 +0000 (09:30 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 27 Aug 2000 09:30:00 +0000 (09:30 +0000)
commit6bf3479c9f21791b1deecb82390c45a0afae8bc8
treefe07777d41db42b6276e0243e8a05de3ebc03509
parent2c8881fa4e5070105c6b19b28e6f9d12bae74fb6
(copy_reg): New parameters: X and NEW_DST.
Remove the SPARSE_MODE parameter.  Update caller.
Perform POSIX-mandated (for cp) open-with-O_WRONLY|O_TRUNC when
the regular destination file exists;  upon failure, unlink
that existing file, then open again, but with O_WRONLY|O_CREAT.
(copy_internal): `force' in not related to interactive; remove
the conjunct.
Remove the entire `else if (x->force)' block;  justifying
removal of the non-directory part is easy:  POSIX requires we try
to open an existing regular file, so we can't unlink it beforehand.
The part that changes the mode on a directory to allow overwriting
isn't necessary.
src/copy.c