tramp-devel
[Top][All Lists]
Advanced

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

Async processes with Tramp, incremental output production with stderr


From: Kai Großjohann
Subject: Async processes with Tramp, incremental output production with stderr
Date: Fri, 04 Jul 2003 18:31:50 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

I have an idea how to implement async subprocesses with Tramp, and
also how to implement the splitting of stdout and stderr together
with incremental output production.

We launch an async subprocess by saying "$CMD 1>/tmp/out.$$ 2>/tmp/err.$$".
We then use "echo $!" to figure out the process id of that subprocess.
We remember all subprocesses currently running.

Every couple of seconds, we look whether output has arrived from one
of the subprocesses.  We do this by getting the size of the file and
comparing it with the remembered size of the file.

We get the new output in the following manner: using dd, we get the
bytes from where we left off last time to the current file size we
just obtained.

We find out if the process is still alive by checking for the process
with ps.

This procedure is complex and error-prone, I'm afraid.

What do people think?
-- 
~/.signature




reply via email to

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