From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Re: Redirecting standard output Date: Thu, 21 Apr 2011 13:19:36 -0600 Organization: XCP-1 Message-ID: <4DB08348.3040208@lanl.gov> References: <83oc402ky4.fsf@gnu.org> <8362q73dap.fsf@gnu.org> <876FF1E0-A9BB-4804-845C-46947AC085EE@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1303413593 22299 80.91.229.12 (21 Apr 2011 19:19:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Apr 2011 19:19:53 +0000 (UTC) Cc: larsi@gnus.org, =?UTF-8?B?SmFuIERqw6Rydg==?= , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 21 21:19:47 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QCzPk-0002Wd-W4 for ged-emacs-devel@m.gmane.org; Thu, 21 Apr 2011 21:19:45 +0200 Original-Received: from localhost ([::1]:49870 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCzPk-0003Iy-GD for ged-emacs-devel@m.gmane.org; Thu, 21 Apr 2011 15:19:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCzPh-0003Id-9R for emacs-devel@gnu.org; Thu, 21 Apr 2011 15:19:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCzPg-0002y5-79 for emacs-devel@gnu.org; Thu, 21 Apr 2011 15:19:41 -0400 Original-Received: from proofpoint5.lanl.gov ([204.121.3.53]:40550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCzPf-0002y1-Rd; Thu, 21 Apr 2011 15:19:40 -0400 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint5.lanl.gov (8.14.3/8.14.3) with ESMTP id p3LJJb0O000334; Thu, 21 Apr 2011 13:19:37 -0600 Original-Received: from x-mail.lanl.gov (x-mail.lanl.gov [128.165.4.125]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 9764915CB5E6; Thu, 21 Apr 2011 13:19:37 -0600 (MDT) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by x-mail.lanl.gov (Postfix) with ESMTP id 94F191DC80A8; Thu, 21 Apr 2011 13:19:37 -0600 (MDT) X-NIE-2-Virus-Scanner: amavisd-new at x-mail.lanl.gov Original-Received: from [128.165.123.182] (xray-r03.lanl.gov [128.165.123.182]) by x-mail.lanl.gov (Postfix) with ESMTP id 569DD1DC80A7; Thu, 21 Apr 2011 13:19:37 -0600 (MDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101220 Lanikai/3.1.7 In-Reply-To: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15, 1.0.148, 0.0.0000 definitions=2011-04-21_05:2011-04-21, 2011-04-21, 1970-01-01 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 204.121.3.53 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138624 Archived-At: >>> On Posix systems, we use a pipe to read from subprocess's STDOUT. You >>> cannot do the same with STDERR, but you can redirect STDERR to a >>> temporary file, and then read it when the subprocess exits. >> >> That is news to me. I've redirected STDERR to a pipe many times in other programs. Why can't it be done in Emacs? > > Maybe I'm missing something, but the call to `pipe' produces only 2 > file descriptors on each end. So you can have either stdout or stderr > of the subprocess, or both of them together, but not both of them > separately. You can call `pipe' more than once; the trouble comes when you have to choose which one to read from to avoid blocking the process. Probably it's just that no one has bothered to implement it carefully enough with `select' or so. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.