From ab9cf4d0bf901c5b84aa36f0bdc4d0860add4d26 Mon Sep 17 00:00:00 2001 From: ueno Date: Fri, 2 May 2003 02:30:01 +0000 Subject: [PATCH] * mime-play.el (mime-activate-mailcap-method): Check the existance of the temporary file. [cf. ] --- ChangeLog | 6 ++++++ mime-play.el | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1a7b83e..ed75ec9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-05-02 Daiki Ueno + + * mime-play.el (mime-activate-mailcap-method): Check the existance + of the temporary file. + [cf. ] + 2003-04-05 Yoichi NAKAYAMA * mime-view.el (mime-preview-toggle-display): Use boundary with diff --git a/mime-play.el b/mime-play.el index a5cbe3e..ecbca96 100644 --- a/mime-play.el +++ b/mime-play.el @@ -139,7 +139,20 @@ specified, play as it. Default MODE is \"play\"." (expand-file-name name temporary-file-directory) (make-temp-name (expand-file-name "EMI" temporary-file-directory)))) - (mime-write-entity-content entity name) + (if (and (not (featurep 'xemacs)) + (>= emacs-major-version 21)) + ;; For security reason, assert the 7th argument of + ;; `write-region' to be 'excl to guarantee that the file is + ;; created atomically. Unfortunately, this feature is not yet + ;; supported in Emacs 20 or XEmacs. + (let ((coding-system-for-write 'binary) + jka-compr-compression-info-list jam-zcat-filename-list) + (write-region (mime-entity-content entity) nil name + nil nil nil 'excl)) + (if (file-exists-p name) + (signal 'file-already-exists + (list "Failed to create temporary file" name)) + (mime-write-entity-content entity name))) (message "External method is starting...") (let ((process (let ((command -- 1.7.10.4