delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/07/14/18:48:53

To: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Cc: djgpp AT delorie DOT com, JT Williams <jeffw AT darwin DOT sfbr DOT org>,
GNU fileutils <bug-fileutils AT gnu DOT org>
Subject: Re: cp -if
References: <20020628133023 DOT GB19395 AT kendall DOT sfbr DOT org>
<3D1ECBF0 DOT 2E1E3EB9 AT phekda DOT freeserve DOT co DOT uk>
<1026506590 DOT 787398 AT queeg DOT ludd DOT luth DOT se>
<20020713132932 DOT GA18926 AT kendall DOT sfbr DOT org>
<3D31AC05 DOT B2CB7082 AT phekda DOT freeserve DOT co DOT uk>
In-Reply-To: <3D31AC05.B2CB7082@phekda.freeserve.co.uk> (Richard Dawe's message of "Sun, 14 Jul 2002 17:51:17 +0100")
From: Jim Meyering <jim AT meyering DOT net>
Date: Mon, 15 Jul 2002 00:16:39 +0200
Message-ID: <87fzymvttk.fsf@pixie.eng.ascend.com>
Lines: 40
User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.3.50 (i686-pc-linux-gnu)
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk> wrote:
> JT Williams wrote:
>>
>> -: : "* cp's -f option no longer cancels the effect of --interactive (-i)
>> -: : (per POSIX)"
>> -:
>> -: Ouch. So how do we override "-i"?

There's a relatively new option just for that.
It was added in 4.1.1.  Here's the NEWS entry:

* mv and cp accept a new option: --reply={yes,no,query};  provides a consistent
    mechanism to control whether one is prompted about certain existing
    destination files.  Note that cp's and mv's -f options don't have the
    same meaning: cp's -f option no longer merely turns off `-i'.

and here's the --help entry:

      --reply={yes,no,query}   specify how to handle the prompt about an
                                 existing destination file


>> Ouch, indeed.  And why only cp?  mv -i can still be overridden.

POSIX requires that cp's -f do this and only this:

  -f, --force                  if an existing destination file cannot be
                                 opened, remove it and try again

POSIX requires that mv's -f override mv's -i.

> I don't know why it's only cp. I had a quick look at draft 7 of the Austin

In the sections for cp and mv (I search for `cp - ' and `mv - ' in d7text.txt),
it's pretty clear that the two -f options are supposed to do different things.

> Group's work, which became part of the new POSIX standard. I can't see where
> the behaviour of cp, mv is described. I've CC'd bug-fileutils. Hopefully
> someone on that list can answer your question.
...

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019