Date: Wed, 5 Mar 1997 13:33:20 +0200 (IST) From: Eli Zaretskii To: Paul Derbyshire cc: djgpp AT delorie DOT com Subject: Re: Output to the Printer In-Reply-To: <5fj1fk$d8i@freenet-news.carleton.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 5 Mar 1997, Paul Derbyshire wrote: > Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) writes: > > On 3 Mar 1997, Paul Derbyshire wrote: > > > >> printer=fopen("PRN:","w"); > > > > Did you actually try this? AFAIK, it should be "PRN", not "PRN:". > > All my DOS manuals call the device PRN:. Same for all the COM, LPT, and CON. You didn't tell if you tried it. However, I just did, and it seems that your manuals are wrong. The little proggy below consistently fails to open "PRN:", but if I change that to "PRN", it succeeds. This is consistent with what I know: the DOS device name is "PRN", not "PRN:". #include int main(void) { FILE *fprn = fopen ("PRN:", "wb"); if (fprn) fprintf (fprn, "Hello, world of printers!\n\f"); else printf ("failed to open\n"); return 0; }