Ergus <spacibba@aol.com> writes:
Hi,
Sorry to bother... I have another question. When we use process-file and
start-file-process with tramp, how can we get the error output in a
buffer?
The argument BUFFER can be a list. The car is the output (string or
buffer), the cdr is the stderr (just a string, a filename).
--8<---------------cut here---------------start------------->8---
(let ((default-directory "/ssh::")
(output (generate-new-buffer "*Output*"))
(stderr "/ssh::/tmp/xxx"))
(process-file "echo" nil (list output stderr) nil "Hallo")
(process-file "echa" nil (list output stderr) nil "Holla")
(find-file stderr))
--8<---------------cut here---------------end--------------->8---
In start-file-process, it is similar. The difference is, that stderr can
be either a string (filename) or a buffer.
--8<---------------cut here---------------start------------->8---
(let ((default-directory "/ssh::")
(output (generate-new-buffer "*Output*"))
(stderr (generate-new-buffer "*Stderr*")))
(start-file-process "test1" (list output stderr) "echo" "Hallo")
(start-file-process "test2" (list output stderr) "echa" "Holla"))
--8<---------------cut here---------------end--------------->8---
Best regards, Michael.