From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.devel Subject: Re: pipe Date: Tue, 17 Mar 2015 16:22:07 +0900 Message-ID: References: <83twxp2mew.fsf@gnu.org> <87h9tp3wsp.fsf-ueno@gnu.org> <87wq2kd5je.fsf@vigenere.g10code.de> <83d24c2c2p.fsf@gnu.org> <87d24bdcgr.fsf@vigenere.g10code.de> <838uez3dcj.fsf@gnu.org> <87y4mzbcqm.fsf@vigenere.g10code.de> <83pp8b1foi.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426576943 22572 80.91.229.3 (17 Mar 2015 07:22:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2015 07:22:23 +0000 (UTC) Cc: Werner Koch , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 17 08:22:22 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YXlpV-0008JA-5t for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 08:22:21 +0100 Original-Received: from localhost ([::1]:53110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXlpU-0002Xr-5K for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 03:22:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXlpQ-0002Xl-Lw for emacs-devel@gnu.org; Tue, 17 Mar 2015 03:22:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXlpP-00051l-Ik for emacs-devel@gnu.org; Tue, 17 Mar 2015 03:22:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXlpP-00051h-FD for emacs-devel@gnu.org; Tue, 17 Mar 2015 03:22:15 -0400 Original-Received: from du-a.org ([2001:e41:db5e:fb14::1]:34611 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YXlpO-0002j3-6b; Tue, 17 Mar 2015 03:22:14 -0400 In-Reply-To: <83pp8b1foi.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Mar 2015 22:34:37 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:183943 Archived-At: Eli Zaretskii writes: >> > But that means it would be impossible to invoke gpg from a shell that >> > can redirect handles beyond the first 3, like some decent port of >> > Bash, is that correct? Or is that where the wrapper comes into play, >> >> I don't know about a native Bash port to Windows. Using Cygwin with >> native Windows programs is problematic has you probably know. > > I was thinking about MSYS Bash. But any port of Bash should do, as > redirecting file handles for a sub-process is trivial. Thanks for all the information. I'm almost lost :-) Are the following assumptions correct? - A subprocess on Windows is able to access a handle passed as an external representation from the parent, as described in the first example of: https://msdn.microsoft.com/en-us/library/aa298531%28v=vs.60%29.aspx - Some shells maintain the mappings between file descriptors and handles, and if Emacs runs a shell program with a redirection to non-standard file descriptors, it might not work as expected - Emacs uses Gnulib's pipe2 implementation around _pipe on native Windows and the returned file descriptors are actually a handle If all of those are correct, perhaps we could just mention the fact that the child ends of a pipe process is a handle on Windows? In any case, supporting stderr could be a starting point, as it seems to be a long-standing request: https://lists.gnu.org/archive/html/emacs-devel/2004-04/msg01051.html and it wouldn't involve a portability issue. Regards, -- Daiki Ueno