changeset 8987:1db2285cec99

(file-ownership-preserved-p): New function.
author Richard M. Stallman <rms@gnu.org>
date Thu, 22 Sep 1994 04:15:33 +0000
parents 331db4842ffb
children 851171bb62d6
files lisp/files.el
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Sep 22 04:11:43 1994 +0000
+++ b/lisp/files.el	Thu Sep 22 04:15:33 1994 +0000
@@ -1429,6 +1429,13 @@
 			 (string-match "~\\'" name)
 			 (length name))))))))
 
+(defun file-ownership-preserved-p (file)
+  "Returns t if deleting FILE and rewriting it would preserve the owner."
+  (let ((handler (find-file-name-handler file 'file-ownership-preserved-p)))
+    (if handler
+	(funcall handler 'file-ownership-preserved-p file)
+      (= (nth 2 (file-attributes file)) (user-uid)))))
+
 (defun file-name-sans-extension (filename)
   "Return FILENAME sans final \"extension\".
 The extension, in a file name, is the part that follows the last `.'."