GNU bug report logs - #62572
cp --no-clobber behavior has changed

Previous Next

Package: coreutils;

Reported by: Alberto Salvia Novella <es20490446e <at> gmail.com>

Date: Fri, 31 Mar 2023 17:49:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Alberto Salvia Novella <es20490446e <at> gmail.com>, Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Sven Joachim <svenjoac <at> gmx.de>, 62572 <at> debbugs.gnu.org
Subject: bug#62572: cp --no-clobber behavior has changed
Date: Sat, 1 Apr 2023 16:43:23 +0100
On 01/04/2023 15:46, Alberto Salvia Novella wrote:
> Also there's now a bigger problem: that you cannot tell when the copy
> failed because the file exists, or because any other reason.
> 
> People will just use:
> cp --no-clover $in $out || true
> 
> But if it fails for any other reason, cross your fingers.
> 
> Hence now the option, in practice, is useless. Nobody should be using it.

Well the current thinking is -n is useful to fail with unexpected existing files.

For the functionality you want of only updating non existent files,
one should use the proposed --update=none new option.

It's worth mentioning that this being a new option
impacts the portability of scripts that use it.

cheers,
Pádraig





This bug report was last modified 1 year and 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.