# HG changeset patch # User Richard M. Stallman # Date 780207333 0 # Node ID 1db2285cec999d26724c156a2c644580a963a60f # Parent 331db4842ffb76b24e53728d6677918f64be503e (file-ownership-preserved-p): New function. diff -r 331db4842ffb -r 1db2285cec99 lisp/files.el --- 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 `.'."