Mail Archives: djgpp/2008/03/28/17:15:24
Lets Go Canes <letsgonhlcanes AT yahoo DOT com> wrote:
>> #include <stdio.h>
>>
>> int main(void) {
>> int ch;
>>
>> while (EOF != (ch = getc(stdin))) putc(ch, stdout);
>> return 0;
>> }
>>
>> should do it. Exercise it by setting stdout to point to the
>> printer. Something like "lpr > LPT".
>
>Maybe I am missing something here, but, doesn't the above program
>just add a null pipe element? In other words, if the above program
>is called lpr, I don't understand how "cat file | lpr > LPT" is an
>improvement over "cat file > LPT". Was the intent that more would
>be added to the program ("season to taste")?
Well, at least in the bash this doesn't work on my pc.
Maybe "LPT" as a device isn't know by default.
But stdprn is defined within the stdio.h of gcc 3.4.3 and so I can
print to this device via "putc ( ch , stdprn ). As Chuck already
mentioned this comes along with the drawback that there is no way to
stop a printout in a similar way like lprm.
So maybe one could capture stdin and as soon as there is an EOF then
send this temporary file to /dos/print with the option to delete a
part or or the whole queue with /dos/print /C (or /T) called from
lprm(.exe).
Best regards,
Markus
--
Please reply to group only.
For private email please use http://www.dipl-ing-kessler.de/email.htm
- Raw text -