[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting file-precious-flag fails to honour umask on new files
From: |
David Howells |
Subject: |
Re: Setting file-precious-flag fails to honour umask on new files |
Date: |
Fri, 16 Jun 2006 10:33:14 +0100 |
Richard Stallman <address@hidden> wrote:
> Does this fix it?
That's not quite right as it chmods the process to umask. What you want is:
*** files.el 12 Jun 2006 14:12:27 -0400 1.844
--- files.el 15 Jun 2006 09:23:00 -0400
***************
*** 3630,3637 ****
(set-visited-file-modtime old-modtime)))
;; Since we have created an entirely new file,
;; make sure it gets the right permission bits set.
! (setq setmodes (or setmodes (cons (file-modes buffer-file-name)
! buffer-file-name)))
;; We succeeded in writing the temp file,
;; so rename it.
(rename-file tempname buffer-file-name t))
--- 3630,3639 ----
(set-visited-file-modtime old-modtime)))
;; Since we have created an entirely new file,
;; make sure it gets the right permission bits set.
! (setq setmodes (or setmodes
! (cons (or (file-modes buffer-file-name)
! (logand ?\666 umask))
! buffer-file-name)))
;; We succeeded in writing the temp file,
;; so rename it.
(rename-file tempname buffer-file-name t))
Thanks,
David