[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dired-copy-preserve-time affects file modes, too.
From: |
Roland Winkler |
Subject: |
Re: dired-copy-preserve-time affects file modes, too. |
Date: |
Thu, 20 Jan 2005 10:24:34 +0100 |
On Wed Jan 19 2005 Richard Stallman wrote:
> While talking about these things, I'd like to suggest that also the
> optional argument keep-time of copy-file could be renamed to
> something more mnemonic like `preserve'.
>
> This argument controls only preservation of the time.
> The name keep-time seems entirely clear.
The last sentence of the docstring for copy-file says
Also set the file modes of the target file to match the source file.
As the previous sentences of this docstring talk about the argument
KEEP-TIME I thought that the last sentence refered to this argument,
too. But according to some quick tests I did, copy-file always
preserves the file mode. So maybe the last sentence of the docstring
for copy-file should say
Always set the file modes of the target file to match the source file.
There is a second thing that fooled me:
The variable dired-copy-preserve-time toggles the behavior of
dired-do-copy and it also affects the prompt when dired-do-copy is
called interactively. If dired-copy-preserve-time is nil the prompt
says "Copy". If it is non-nil, the prompt says "Copy [-p]".
However, the info page from GNU Coreutils says about the options of
the command cp
Using `--preserve' with no ATTRIBUTE_LIST is equivalent to
`--preserve=mode,ownership,timestamps'.
Therefore, I was expecting that dired-copy-preserve-time toggled
whether dired-do-copy behaves like `cp' or `cp --preserve'.
(In the end, the command dired-do-copy calls copy-file. Therefore,
the former 'inherits' these features from the latter.)
Roland