Is stdprn opened in binary or text mode? 
Author Message
 Is stdprn opened in binary or text mode?

Hi, all C/C++-ers:

I recently took some experiment about printing.
Now I have a change to write a byte 0x1a (Ctrl+Z)
to printer (stdprn).

Ok, the run-time library did not let me to do so!
Is there any other PORTABLE method which I can use?

Thanks in advance if you can give me a kind hand...

- tony

--


! Lee-fruit, Shih-scholar, Hao-hero        WWW http://www.*-*-*.com/ ~tony



Sat, 30 May 1998 03:00:00 GMT  
 Is stdprn opened in binary or text mode?

Quote:
>Now I have a change to write a byte 0x1a (Ctrl+Z)
>to printer (stdprn).

>Ok, the run-time library did not let me to do so!
>Is there any other PORTABLE method which I can use?

Use a binary stream.  The one you tried to use is obviously not binary.
Opening a binary stream to the printer is highly system specific, but
it looks like this:

binprn = fopen("system_specific_magic", "wb");

Dan
--
Dan Pop
CERN, CN Division

Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland



Sat, 30 May 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Text mode or binary mode ?

2. reading text files in binary mode

3. Binary and Text Modes and Stdin/Stdout

4. readable binary in text mode

5. readable binary in text mode

6. HELP with stdprn in BINARY

7. how to truncate a file opened in text mode

8. Opening a file in text or binary format?

9. Open a BINARY file as text??

10. ofstream binary mode not binary?

11. Problem with opening binary files using open()

12. Print a text file in text mode to the printer

 

 
Powered by phpBB® Forum Software