From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: pipe Date: Sat, 14 Mar 2015 15:42:04 +0200 Message-ID: <838uez3dcj.fsf@gnu.org> References: <83twxp2mew.fsf@gnu.org> <87h9tp3wsp.fsf-ueno@gnu.org> <87wq2kd5je.fsf@vigenere.g10code.de> <83d24c2c2p.fsf@gnu.org> <87d24bdcgr.fsf@vigenere.g10code.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1426340555 23945 80.91.229.3 (14 Mar 2015 13:42:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Mar 2015 13:42:35 +0000 (UTC) Cc: ueno@gnu.org, emacs-devel@gnu.org To: Werner Koch Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 14 14:42:25 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 1YWmKc-0000Aj-CV for ged-emacs-devel@m.gmane.org; Sat, 14 Mar 2015 14:42:22 +0100 Original-Received: from localhost ([::1]:40844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWmKb-0003aZ-Mb for ged-emacs-devel@m.gmane.org; Sat, 14 Mar 2015 09:42:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWmKV-0003aK-Tj for emacs-devel@gnu.org; Sat, 14 Mar 2015 09:42:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWmKS-0000Sl-N4 for emacs-devel@gnu.org; Sat, 14 Mar 2015 09:42:15 -0400 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:37615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWmKS-0000S9-EL; Sat, 14 Mar 2015 09:42:12 -0400 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NL700C00EUB2B00@mtaout26.012.net.il>; Sat, 14 Mar 2015 15:42:52 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NL700EMHFFG2H00@mtaout26.012.net.il>; Sat, 14 Mar 2015 15:42:52 +0200 (IST) In-reply-to: <87d24bdcgr.fsf@vigenere.g10code.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.182 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:183868 Archived-At: > From: Werner Koch > Cc: ueno@gnu.org, emacs-devel@gnu.org > Date: Sat, 14 Mar 2015 12:51:00 +0100 > > On Sat, 14 Mar 2015 09:54, eliz@gnu.org said: > > > Thanks, but where do I see the source of that wrapper? I tried the > > gpg Git repo, but I don't think I see it there. Did I miss something? > > It is in gpgme, a library interface to gnupg: > > git://git.gnupg.org/gpgme.git Thanks. > > And anyway, how does this wrapper solve the problem of invoking gpg > > with the --status-fd, --command-fd, and --attribute-fd options? IOW, > > how can the invoking program pass file descriptors on the gpg command > > line, and be sure gpg will use the same files/devices as the caller? > > Use gpgme ;-) > > Simply use "--status-fd HANDLE" or if gpg expects a filename use the > option --enable-special-filenames which interprets filename of the form > "-&N" as the handle N. > > Under Windows we use a HANDLE and not a file descriptor. OK, if handles are used, then the rest is clear. (Your original message talked about file descriptors, which is what confused me.) 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, in some way? > > that allows this to work, but AFAIK that doesn't work with MinGW, only > > Nope. It is all specified by the Win32 API. Again, I was talking about file descriptors; the Win32 API knows nothing about those. MS runtime passes the translation table between handles and file descriptors through undocumented fields of STARTUPINFO, but using that needs special startup code, which only MSVC supplies, AFAIK. > If you are interest in details on this I suggest to read Hart's > Windows System Programming. I consider this the Windows counterpart > to APUE. Thanks, I have that book in my possession since long ago, and studied it already (and continue studying it).