Mail Archives: djgpp/1997/03/06/18:04:32
On Wed, 5 Mar 1997 13:33:20 +0200 (IST), you wrote:
>Things are changing at NetForward!
>http://www.netforward.com/changes.shtml
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>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:
>> >=20
>> >> printer=3Dfopen("PRN:","w");
>> >=20
>> > Did you actually try this? AFAIK, it should be "PRN", not "PRN:".
>>=20
>> 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:".=20
>
>#include <stdio.h>
>int main(void)
>{
> FILE *fprn =3D fopen ("PRN:", "wb");
>
> if (fprn)
> fprintf (fprn, "Hello, world of printers!\n\f");
> else
> printf ("failed to open\n");
> return 0;
>}
>
I know we're all off topic here, but I'm just curious. I've always
thought that PRN and PRN: were just like synonymous for DOS (and so
were AUX and AUX:, etc..) , so I tried the little Eli's example and
worked as I expected that is it printed the string (well actually it
don't 'cos I don't have a printer, but Win95 tried to and give me an
error when realized that there wasn't one). I've also tried something
like TYPE AUTOEXEC.BAT > PRN: and the result was the same.=20
Maybe are you using OpenDos or something similar that react in a
different way, Eli ?
- Raw text -