[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: |
Pascal J. Bourguignon |
Subject: |
Re: How to communicate with a running external process with given PID? |
Date: |
Mon, 22 Jul 2013 20:16:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Aurélien Aptel <aurelien.aptel+emacs@gmail.com> writes:
> 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.
Which do you no good, if that process has closed fds 0, 1 and 2, as any
good daemon process would do.
--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.
You know you've been lisping too long when you see a recent picture of George
Lucas and think "Wait, I thought John McCarthy was dead!" -- Dalek_Baldwin
Re: How to communicate with a running external process with given PID?, Pascal J. Bourguignon, 2013/07/20