Mail Archives: djgpp/1997/03/09/10:54:59
On Thu, 6 Mar 1997, Marco Salvalaggio wrote:
> >#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,
I fail to see how that could be true. I just tried the above program
on Windows 95 and it failed for names with colons. Can you try that
on a system that does have a printer?
> but Win95 tried to and give me an
> error when realized that there wasn't one).
Are you sure that was Windows and not the program? It also ``gives an
error message'' if it fails to open the printer. What message did you
see?
> I've also tried something
> like TYPE AUTOEXEC.BAT > PRN: and the result was the same.
Like I said in another message, this is just an artifact of how
COMMAND.COM parses filenames, it doesn't say anything about what DOS
knows. (As another example, recall that DOS can grok filenames with
forward slashes, while COMMAND.COM chokes on them.)
> Maybe are you using OpenDos or something similar that react in a
> different way, Eli ?
No, I tested that program on plain DOS 6.2.
- Raw text -