emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pipe


From: Eli Zaretskii
Subject: Re: pipe
Date: Sat, 14 Mar 2015 15:42:04 +0200

> From: Werner Koch <address@hidden>
> Cc: address@hidden,  address@hidden
> Date: Sat, 14 Mar 2015 12:51:00 +0100
> 
> On Sat, 14 Mar 2015 09:54, address@hidden 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).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]