X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Markus R. Keßler" Newsgroups: comp.os.msdos.djgpp Subject: Re: lpr for djgpp? Date: Fri, 28 Mar 2008 23:18:24 +0100 Organization: Nein Danke Message-ID: References: <47EC0DA5 DOT 25D02455 AT yahoo DOT com> <726273 DOT 36095 DOT qm AT web50706 DOT mail DOT re2 DOT yahoo DOT com> X-Newsreader: Forte Agent 1.91/16.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 39 NNTP-Posting-Date: 28 Mar 2008 23:11:58 CET NNTP-Posting-Host: b7918b8b.newsspool1.arcor-online.net X-Trace: DXC===NMT`RCOkY\PS5Xo=M[RVic==]BZ:af^4Fo<]lROoRQ8kF1USLPAZfR9KATjYgegG?cW>T9OH4 AT R:X?IS X-Complaints-To: usenet-abuse AT arcor DOT de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Lets Go Canes wrote: >> #include >> >> 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