"--passphrase-fd n" not working

Werner Koch wk@gnupg.org
Mon Oct 1 23:46:01 2001


On Mon, 01 Oct 2001 16:21:37 -0400, pd  said:


> I can't get it to work. When I put in a filename it says it is
> looking for file descriptor 0. Is the file descriptor here something
> different than the filename? I tried inode number and that doesn't
Yes, it is different. I suggest that you read some basic text on Unix like Steven's APUE. Or try it out: The standard output is usually assigned to FD 1, standard error to FD 2. You might have notices things like foo 2>/dev/null which sends all error output (standard error = FD 2) to the /dev/null file/device. Or the more common one: foo >myfile which is the same as foo 1>myfile So, why do we want to pass FD on the commandline? Not all FD are assigned to a file, oftne they are ahndles for pipes which are used for interprocess communication like: foo | bar where the shell build a pipe to direct the fd 1 of foo to the fd 0 of bar. See the source of gpgme for an example on how to use this gpg feature. strace may help you to get idea what's going on tehre. Hth, Werner -- Werner Koch Omnis enim res, quae dando non deficit, dum habetur g10 Code GmbH et non datur, nondum habetur, quomodo habenda est. Privacy Solutions -- Augustinus