From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: How to communicate with a running external process with given PID? Date: Mon, 22 Jul 2013 20:16:41 +0200 Organization: Informatimago Message-ID: <87ehaq5uk6.fsf@informatimago.com> References: <87fvv9ha6o.fsf@gmail.com> <87txjmy97l.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1374517227 5951 80.91.229.3 (22 Jul 2013 18:20:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jul 2013 18:20:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 22 20:20:29 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V1Kie-0007bj-KS for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jul 2013 20:20:24 +0200 Original-Received: from localhost ([::1]:59365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Kie-00087x-3A for geh-help-gnu-emacs@m.gmane.org; Mon, 22 Jul 2013 14:20:24 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net OIvDDoXGluXLG8Q3IPROzAtmQtA2C5bkjgCQH9AcL/VCxSbHBs Cancel-Lock: sha1:MDk4YTI4ZDhjZDk2MmU1ODY0OGVlZTk3NGFjZmVlYmFhMGFiZDc0Mw== sha1:Nyk71KuaCddpMMVUyJgNEw/Enlg= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:200064 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92330 Archived-At: Aurélien Aptel writes: > On Mon, Jul 22, 2013 at 4:12 PM, Thorsten Jolitz 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