help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to communicate with a running external process with given PID?


From: Aurélien Aptel
Subject: Re: How to communicate with a running external process with given PID?
Date: Mon, 22 Jul 2013 16:42:33 +0200

On Mon, Jul 22, 2013 at 4:12 PM, Thorsten Jolitz <tjolitz@gmail.com> wrote:
>> Since Emacs did not start the external process, it does not have
>> access to its standard input stream -- unless your OS provides a way
>> to do that (e.g. via a special /dev file).
>>
>> How would you communicate with the external process, from any other
>> program?
>
> I don't know, and I interpreted the responses so far to my post as "it
> is impossible, only 'kill' can access the running external process with
> given PID" - but kill sends signals, no command-strings or so.

Kevin is right in that on Linux you can use /proc/$PID/fd/0 and 1 to
access the file descriptor of the stdin and stdout of the program
$PID. Actually, it's the input/output of the controlling terminal
which means you have to use some tricks [1] to communicate with the
process.

1: 
http://stackoverflow.com/questions/5374255/how-to-write-data-to-existing-processs-stdin-from-external-process?lq=1



reply via email to

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