www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/24/05:39:15

Date: Wed, 24 Sep 1997 12:37:09 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Peter J. Farley III" <pjfarley AT dorsai DOT org>
cc: djgpp AT delorie DOT com
Subject: Re: Printing on the printer
In-Reply-To: <342872c0.5802270@snews.zippo.com>
Message-ID: <Pine.SUN.3.91.970924123534.18049T-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019