emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/tramp-fish.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp-fish.el,v
Date: Sat, 06 Oct 2007 12:00:43 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/10/06 12:00:42

Index: net/tramp-fish.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp-fish.el,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- net/tramp-fish.el   4 Oct 2007 20:09:32 -0000       1.9
+++ net/tramp-fish.el   6 Oct 2007 12:00:42 -0000       1.10
@@ -734,8 +734,8 @@
     (error "Implementation does not handle immediate return"))
 
   (with-parsed-tramp-file-name default-directory nil
-    (let ((temp-name-prefix (tramp-make-tramp-temp-file v))
-         command input output stderr outbuf tmpfile ret)
+    (let (command input tmpinput output tmpoutput stderr tmpstderr
+                 outbuf tmpfile ret)
       ;; Compute command.
       (setq command (mapconcat 'tramp-shell-quote-argument
                               (cons program args) " "))
@@ -747,15 +747,14 @@
            ;; INFILE is on the same remote host.
            (setq input (with-parsed-tramp-file-name infile nil localname))
          ;; INFILE must be copied to remote host.
-         (setq input (concat temp-name-prefix ".in"))
-         (copy-file
-          infile
-          (tramp-make-tramp-file-name method user host input)
-          t)))
+         (setq input (tramp-make-tramp-temp-file v)
+               tmpinput (tramp-make-tramp-file-name method user host input))
+         (copy-file infile tmpinput t)))
       (when input (setq command (format "%s <%s" command input)))
 
       ;; Determine output.
-      (setq output (concat temp-name-prefix ".out"))
+      (setq output (tramp-make-tramp-temp-file v)
+           tmpoutput (tramp-make-tramp-file-name method user host output))
       (cond
        ;; Just a buffer
        ((bufferp destination)
@@ -781,7 +780,9 @@
                               (cadr destination) nil localname))
            ;; stderr must be copied to remote host.  The temporary
            ;; file must be deleted after execution.
-           (setq stderr (concat temp-name-prefix ".err"))))
+           (setq stderr (tramp-make-tramp-temp-file v)
+                 tmpstderr (tramp-make-tramp-file-name
+                            method user host stderr))))
         ;; stderr to be discarded
         ((null (cadr destination))
          (setq stderr "/dev/null"))))
@@ -790,9 +791,6 @@
        (setq outbuf (current-buffer))))
       (when stderr (setq command (format "%s 2>%s" command stderr)))
 
-      ;; If we have a temporary file, it must be removed after operation.
-      (when (and input (string-match temp-name-prefix input))
-       (setq command (format "%s; rm %s" command input)))
       ;; Goto working directory.
       (unless
          (tramp-fish-send-command-and-check
@@ -821,16 +819,15 @@
            ;; We should show the output anyway.
            (when outbuf
              (with-current-buffer outbuf (insert-file-contents tmpfile))
-             (when display (display-buffer outbuf)))
-           ;; Remove output file.
-           (delete-file (tramp-make-tramp-file-name method user host output)))
+             (when display (display-buffer outbuf))))
        ;; When the user did interrupt, we should do it also.
        (error (setq ret 1)))
-      (unless ret
+
        ;; Provide error file.
-       (when (and stderr (string-match temp-name-prefix stderr))
-         (rename-file (tramp-make-tramp-file-name method user host stderr)
-                      (cadr destination) t)))
+      (when tmpstderr (rename-file tmpstderr (cadr destination) t))
+      ;; Cleanup.
+      (when tmpinput (delete-file tmpinput))
+      (when tmpoutput (delete-file tmpoutput))
       ;; Return exit status.
       ret)))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]