changeset 1161:5bfabf7de8e9

*** empty log message ***
author Roland McGrath <roland@gnu.org>
date Fri, 18 Sep 1992 07:30:25 +0000
parents f7b55bfe1c05
children 7d6e0669b3dc
files lisp/mail/rmail.el
diffstat 1 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Fri Sep 18 07:29:36 1992 +0000
+++ b/lisp/mail/rmail.el	Fri Sep 18 07:30:25 1992 +0000
@@ -528,7 +528,19 @@
 	    ;; Delete the old files, now that babyl file is saved.
 	    (while delete-files
 	      (condition-case ()
-		  (delete-file (car delete-files))
+		  (if (or (string= (file-name-directory (car delete-files))
+				   rmail-spool-directory)
+			  (string-match "^\\.newmail-"
+					(file-name-nondirectory (car delete-files))))
+		      ;; If the file's in the spool directory, try deleting.
+		      ;; Likewise if made with movemail.
+		      (condition-case ()
+			  (delete-file (car delete-files))
+			(file-error
+			 ;; If we can't delete it, truncate it.
+			 (write-region (point) (point) (car delete-files))))
+		    ;; If not in the spool dir, just truncate it.
+		    (write-region (point) (point) (car delete-files)))
 		(file-error nil))
 	      (setq delete-files (cdr delete-files)))))
 	(if (= new-messages 0)
@@ -573,7 +585,10 @@
 	    (if (file-directory-p file)
 		(setq file (expand-file-name (user-original-login-name)
 					     file)))))
-      (if (or (file-exists-p tofile) (file-exists-p file))
+      (if (or (and (file-exists-p tofile)
+		   (/= 0 (nth 7 (file-attributes tofile))))
+	      (and (file-exists-p file)
+		   (/= 0 (nth 7 (file-attributes file)))))
 	  (message "Getting mail from %s..." file))
       ;; Set TOFILE if have not already done so, and
       ;; rename or copy the file FILE to TOFILE if and as appropriate.