questions: no input file, and pascal programming

Philip subs at christiantena.net
Mon May 4 01:25:34 CEST 2009


Hmm, that would spoil things.

reading this
http://www.velocityreviews.com/forums/t365339-p-write-eof-without-closing.html
the opinion there is that sending control-Z is just a signal from the 
keyboard to the shell which the shell uses to cut the flow to the 
application listening on stdin, it doesn't actually send control-z to 
the app.

in other words I need to flush and close the input side of the pipe, but 
not the output side or won't collect the program output.

I was hoping that tprocess.CloseInput might acheive that but it doesn't 
seem to cause gpg to stop listening for input.

Anyone got any ideas?

thanks, Philip

James P. Howard, II wrote:
> Under DOS, redirecting from the standard output of A to the standard
> input of B meant the contents were stored in a temporary file somewhere,
> due to DOS's inability to multitask.  It's worth checking to be sure
> Windows still doesn't do that when running those at the command line.
> 
> James
> 
> On Sun May  3 11:22:54 2009, Philip <subs at christiantena.net> wrote:
> 
>> I spent a little time coding in windows today (using lazarus).
>> I have come to the conclusion that you can pipe stuff to gpg from inside
>> dos window, but that if you try to pipe stuff directly from the pascal
>> program it fails.
>> I actually got my program to work by piping to cmd.exe with "echo Mary
>> had a little lamb|gpg" inside the stream, which sort of proves that I
>> know how to program a pipe.
>> Example code is at
>> http://www.christiantena.net/freepascalgpgexample.zip
>>
>> you can look at this code by installing lazarus, unziping the above file
>> into a folder, and then from lazarus do project/open project and point
>> it at the lpi file in the folder
>>
>> hit F9 to compile it
>>
>> This feels a bit like a bug in gpg to me...
>>
>> regards, Philip
>>
>> Philipp Schafft wrote:
>>> reflum,
>>>
>>> On Sun, 2009-05-03 at 10:22 +0100, Philip wrote:
>>>> So far I have figured out that on windows if I enter the command
>>>> gpg -eat -r [recipient key]
>>>>
>>>> I get a prompt on the console
>>>> If I then type a message, followed by <enter> control-Z <enter>
>>>> then gpg will encrypt the message and dump the pgp text to the screen,
>>>> or to a file if I used the -o [filename] option.
>>>>
>>>> However on linux control-Z just terminates the program (no pgp text)
>>>>
>>>> Does anyone know the official, correct console way to get pgp to
>>>> terminate and output the encrypted text from console?
>>>>
>>>> I'm amazed that it just doesn't seem to be documented anywhere.
>>> Take a look at the ASCII table (man ascii :). There is ^D (EOT - end of
>>> transmission) for this. This is used by all systems I'm aware of but
>>> window$. Don't know why they use something diffrent, maybe just to be
>>> diffrent and break the standard.
>>>
>>>
>>
>> _______________________________________________
>> Gnupg-users mailing list
>> Gnupg-users at gnupg.org
>> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 




More information about the Gnupg-users mailing list