* copy-file: ok-if-already-exists versus mustbenew
@ 2006-05-15 16:09 Lennart Borgman
2006-05-15 17:57 ` Luc Teirlinck
0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman @ 2006-05-15 16:09 UTC (permalink / raw)
I am trying to enhance my reading capabilities, but I can not understand
the difference between the arguments ok-if-already-exists and mustbenew
in the doc for `copy-file'. Can someone please explain this to me?
The only difference I see is that "never overwrite" is mentioned for
"mustbenew" - though I hope this holds for the first argument too.
However it sounds like the second argument should be about modification
times, but the doc string does not say so.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: copy-file: ok-if-already-exists versus mustbenew
2006-05-15 16:09 copy-file: ok-if-already-exists versus mustbenew Lennart Borgman
@ 2006-05-15 17:57 ` Luc Teirlinck
2006-05-15 20:11 ` Lennart Borgman
2006-05-16 4:28 ` Richard Stallman
0 siblings, 2 replies; 4+ messages in thread
From: Luc Teirlinck @ 2006-05-15 17:57 UTC (permalink / raw)
Cc: emacs-devel
Lennart Borgman wrote:
I am trying to enhance my reading capabilities, but I can not understand
the difference between the arguments ok-if-already-exists and mustbenew
in the doc for `copy-file'. Can someone please explain this to me?
The only difference I see is that "never overwrite" is mentioned for
"mustbenew" - though I hope this holds for the first argument too.
I do not immediately see the difference either. mustbenew was
introduced by the following change:
2005-04-23 Richard M. Stallman <rms@gnu.org>
* fileio.c (Fcopy_file): New arg MUSTBENEW.
(Frename_file): Pass new arg to Fcopy_file.
I do not immediately understand why Frename_file could not have used
the ok-if-already-exists arg.
However it sounds like the second argument should be about modification
times, but the doc string does not say so.
I do not understand this one. I assume you mean the second _optional_
argument. From the docstring:
Fourth arg keep-time non-nil means give the output file the same
last-modified time as the old one. (This works on only some systems.)
Another problem is that the preserve-uid-gid arg is not mentioned in
the `(elisp)Changing Files' description of copy-file.
Sincerely,
Luc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: copy-file: ok-if-already-exists versus mustbenew
2006-05-15 17:57 ` Luc Teirlinck
@ 2006-05-15 20:11 ` Lennart Borgman
2006-05-16 4:28 ` Richard Stallman
1 sibling, 0 replies; 4+ messages in thread
From: Lennart Borgman @ 2006-05-15 20:11 UTC (permalink / raw)
Cc: emacs-devel
Luc Teirlinck wrote:
> Lennart Borgman wrote:
>
> I am trying to enhance my reading capabilities, but I can not understand
> the difference between the arguments ok-if-already-exists and mustbenew
> in the doc for `copy-file'. Can someone please explain this to me?
>
>
>
...
> However it sounds like the second argument should be about modification
> times, but the doc string does not say so.
>
> I do not understand this one. I assume you mean the second _optional_
> argument. From the docstring:
>
By "second" I meant "mustbenew" here.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: copy-file: ok-if-already-exists versus mustbenew
2006-05-15 17:57 ` Luc Teirlinck
2006-05-15 20:11 ` Lennart Borgman
@ 2006-05-16 4:28 ` Richard Stallman
1 sibling, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2006-05-16 4:28 UTC (permalink / raw)
Cc: lennart.borgman.073, emacs-devel
There are two meaningful non-nil settings for MUSTBENEW: `excl' and
anything else (such as t).
Using t seems to be more or less equivalent to specifying an integer
for OK_IF_ALREADY_EXISTS, but `excl' does something different: it
passes the flag to `open' which causes it to fail if the file exists.
That feature is used in `backup-buffer-copy'.
It would be easy to eliminate the special case for t, since that
does nothing new. However, the `excl' case does something new.
I see two ways to eliminate it:
* Set the O_EXCL flag for OK_IF_ALREADY_EXISTS = `excl' instead.
* Set the O_EXCL flag when OK_IF_ALREADY_EXISTS is any symbol.
Does anyone see a problem with either of these?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-05-16 4:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-15 16:09 copy-file: ok-if-already-exists versus mustbenew Lennart Borgman
2006-05-15 17:57 ` Luc Teirlinck
2006-05-15 20:11 ` Lennart Borgman
2006-05-16 4:28 ` Richard Stallman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.