From cb0cd911679ab4b165a222d19f72ce9b9bc23da7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 22 Sep 1994 04:15:33 +0000 Subject: [PATCH] (file-ownership-preserved-p): New function. --- lisp/files.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index b26da5dde77..93467439621 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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 `.'." -- 2.39.5