[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs doesn't preserve the file access permission.
From: |
Reiner Steib |
Subject: |
Re: Emacs doesn't preserve the file access permission. |
Date: |
Sun, 02 Jan 2005 19:41:49 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
On Sat, Jan 01 2005, Hiroshi Fujishima wrote:
> Editing a file with Emacs doesn't preserve the file's permission.
>
> % mkdir temporally-working-directory
> % cd temporally-working-directory
> % umask
> 022
> % touch x
> % chmod 600 x
> % ls -l
> total 0
> -rw------- 1 pooh staff 0 Jan 1 19:54 x
> % emacs x
> % ls -l
> total 1
> -rw-r--r-- 1 pooh staff 21 Jan 1 19:55 x
> -rw------- 1 pooh staff 0 Jan 1 19:54 x~
>
> I expect ``-rw------- 1 pooh staff 21 Jan 1 19:55 x'', not
> ``-rw-r--r-- 1 pooh staff 21 Jan 1 19:55 x''.
You probably want to set `backup-by-copying' to t. Its doc string
refers to `make-backup-files':
,----[ C-h v make-backup-files RET ]
| make-backup-files's value is nil
|
| *Non-nil means make a backup of a file the first time it is saved.
| This can be done by renaming the file or by copying.
|
| Renaming means that Emacs renames the existing file so that it is a
| backup file, then writes the buffer into a new file. Any other names
| that the old file had will now refer to the backup file. The new file
| is owned by you and its group is defaulted.
|
| Copying means that Emacs copies the existing file into the backup
| file, then writes the buffer on top of the existing file. Any other
| names that the old file had will now refer to the new (edited) file.
| The file's owner and group are unchanged.
|
| The choice of renaming or copying is controlled by the variables
| `backup-by-copying', `backup-by-copying-when-linked',
| `backup-by-copying-when-mismatch' and
| `backup-by-copying-when-privileged-mismatch'. See also `backup-inhibited'.
`----
The doc string mentions owner and group but not permissions. I think
there should be a sentence on permissions.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/