]> git.eshelyaron.com Git - emacs.git/commitdiff
(file-ownership-preserved-p): New function.
authorRichard M. Stallman <rms@gnu.org>
Thu, 22 Sep 1994 04:15:33 +0000 (04:15 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 22 Sep 1994 04:15:33 +0000 (04:15 +0000)
lisp/files.el

index b26da5dde775e27e6fee355e26276f2f98630261..934674396215a48592bb2217711a1cdda3bc930b 100644 (file)
@@ -1429,6 +1429,13 @@ we do not remove backup version numbers, only true file version numbers."
                         (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 `.'."