On Mon, 25 Mar 2024 08:33, Bee said:

> C:\Program Files (x86)\GnuPG\bin>type HelloWorld.txt | .\gpg.exe 
> --passphrase-fd 3 -c  3< HelloWorld.txt
>> gpg: failed to translate osfhandle 0x00000003

gpg takes system handles and not libc file descriptors.  File
descriptors 0, 1, and 2 are handled by Windows in a different.  All
other depend on which ABI you work.  cmd.exe seems to expect file
descriptors which is good for scripting but gpg is rarely used in such a
scripting environment but usuallay directly executed by CreateProcess
and thus expects HANDLE values and not file descriptors.

See gnupg/common/sysutils.c:translate_sys2libc_fd

Actually it would be possible to provide an option to disable this
translation and instead use libc file descriptors (with all the fun if
different runtimes are used) but in more than 20 years we have not seen
such a demand.


Salam-Shalom,

   Werner

-- 
The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein

Attachment: openpgp-digital-signature.asc
Description: PGP signature

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to