[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy-file: ok-if-already-exists versus mustbenew

From: Richard Stallman
Subject: Re: copy-file: ok-if-already-exists versus mustbenew
Date: Tue, 16 May 2006 00:28:47 -0400

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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]