Go to the first, previous, next, last section, table of contents.


Backup by Renaming or by Copying?

There are two ways that Emacs can make a backup file:

The first method, renaming, is the default.

The variable backup-by-copying, if non-nil, says to use the second method, which is to copy the original file and overwrite it with the new buffer contents. The variable file-precious-flag, if non-nil, also has this effect (as a sideline of its main significance). See section Saving Buffers.

Variable: backup-by-copying
If this variable is non-nil, Emacs always makes backup files by copying.

The following two variables, when non-nil, cause the second method to be used in certain special cases. They have no effect on the treatment of files that don't fall into the special cases.

Variable: backup-by-copying-when-linked
If this variable is non-nil, Emacs makes backups by copying for files with multiple names (hard links).

This variable is significant only if backup-by-copying is nil, since copying is always used when that variable is non-nil.

Variable: backup-by-copying-when-mismatch
If this variable is non-nil, Emacs makes backups by copying in cases where renaming would change either the owner or the group of the file.

The value has no effect when renaming would not alter the owner or group of the file; that is, for files which are owned by the user and whose group matches the default for a new file created there by the user.

This variable is significant only if backup-by-copying is nil, since copying is always used when that variable is non-nil.


Go to the first, previous, next, last section, table of contents.