Mail Archives: djgpp/1997/09/24/05:39:15
On Wed, 24 Sep 1997, Peter J. Farley III wrote:
> Use "PRN:" as the filename. Try this:
>
> #include <stdio.h>
> #include <errno.h>
>
> main()
> {
> FILE *prntr;
>
> if ((prntr = fopen("PRN:", "w")) == NULL) {
> printf("Error %d! %s: %s\n", errno, "PRN:", strerror(errno));
> exit(1);
Did you actually try this? "PRN:" fails for me; "PRN" (without the
colon) works.
DOS knows the device names without the colon, so it's a bad idea to
include them when you call `fopen'.
- Raw text -