Subject: bug#29315: closed (Re: bug#29315: info cp: documentation feedback)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 10 Dec 2017 00:24:02 +0000

Your bug report

#29315: info cp: documentation feedback

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
29315: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29315
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#29315: info cp: documentation feedback
From: Pádraig Brady <[email-masked]>
To: kalle <[email-masked]>, [email-masked]
Date: Sat, 9 Dec 2017 16:23:24 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

On 16/11/17 03:36, kalle wrote:
> hello,
> here some mistakes/improvement proposals to `info cp' from me:
>
> -sentence "If the `--target": take away "failing that"?

It's better as is, to document that these are separate modes

> -sentence "descending into source directories": shouldn't it be rather
> "descending into SOURCE's directories"?

That could be interpreted as only descending one level

> And since `-r' and `-R' is the
> same: write "-r/-R" instead.

That would be less standard/searchable

> -option `-f': why is it written about _opening_ a file, e.g. "opened for
> writing" and not simply "writeable"?

There can be differing restrictions on various operations,
so we're being explicit about the truncation permission.

> What is meant by "removes it and
> tries to open it again"?

It creates a new file rather than rewriting an existing one.
I suppose that could be clarified. Patch attached.

> It is said "`cp' then removes it". It should be
> added ", if the user has write-permission in the containing directory."

There are other permissions that may block the unlink also.
It's better not to partially list potential issues,
and just state what cp does.

> -part "-i": shouldn't be written "When copying to a file" instead?

Subtly no, because we prompt if overwriting a dir with a file.
So the prompt depends on the source, not the dest.

cheers,
Pádraig.
>From f17c1df3919d66fd1e71057070604f9af6d4bcc5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email-masked]>
Date: Sat, 9 Dec 2017 16:18:00 -0800
Subject: [PATCH] doc: clarify that cp --force may recreate files

* doc/coreutils.texi (cp invocation): The language used
to describe recreating the file was a little confusing
as it mentioned opening a removed file.
Fixes https://bugs.gnu.org/29315
---
 doc/coreutils.texi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 09730f6..ed3a633 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -8520,8 +8520,9 @@ Equivalent to @option{--no-dereference --preserve=links}.
 @opindex --force
 When copying without this option and an existing destination file cannot
 be opened for writing, the copy fails.  However, with @option{--force},
-when a destination file cannot be opened, @command{cp} then removes it and
-tries to open it again.  When this option is combined with
+when a destination file cannot be opened, @command{cp} then
+tries to recreate the file by first removing it.
+When this option is combined with
 @option{--link} (@option{-l}) or @option{--symbolic-link}
 (@option{-s}), the destination link is replaced, and unless
 @option{--backup} (@option{-b}) is also given there is no brief
-- 
2.9.3

Subject: info cp: documentation feedback
From: kalle <[email-masked]>
To: [email-masked]
Date: Thu, 16 Nov 2017 12:36:06 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

hello,
here some mistakes/improvement proposals to `info cp' from me:

-sentence "If the `--target": take away "failing that"?
-sentence "descending into source directories": shouldn't it be rather
"descending into SOURCE's directories"?And since `-r' and `-R' is the
same: write "-r/-R" instead.
-option `-f': why is it written about _opening_ a file, e.g. "opened for
writing" and not simply "writeable"? What is meant by "removes it and
tries to open it again"? It is said "`cp' then removes it". It should be
added ", if the user has write-permission in the containing directory."
-part "-i": shouldn't be written "When copying to a file" instead?

greetings,
kalle