Mail Archives: djgpp/1999/03/07/06:46:45
On Fri, 5 Mar 1999, David Nugent wrote:
> When it goes to the printer, the printer's data
> light flashes for a few seconds, and then the error light
> comes on. I originally tried sending the file to stdprn,
> and thought this is where the problem was.
You need to switch stdprn to binary mode, if the data is binary, like
this:
setmode (fileno (stdprn), O_BINARY);
> So then I
> wrote the output to a file and then did a
> "COPY /B FILENAME LPT1:" This worked. Now if I take the
> same file, and from within my program issue...
>
> system ("copy /B filename LPT1:");
This should have worked (although you might lose the trailing colon,
which is not part of the printer's device name); it worked for me.
Please try to do this from a trivial one-line program, and see if that
works. If it does, the problem is with the rest of code in the larger
program.
If the short program doesn't work either, maybe your setup sets the
SHELL or COMSPEC environment variables to something unusual. `system'
uses these variables to decide what shell to invoke.
- Raw text -