[comp.sys.ibm.pc] Sending Ctrl-Z to PRN .... is it possible ?

des@yatton.inmos.co.uk (David Shepherd) (09/08/89)

I am running a program on a PC compatible which generates bitmaps to send to
an Star printer (the program is based on DVIEPS a TeX DVI to Epson processor).
The problem is that these bitmaps will every so often contain a Control-Z
(0x1a) byte. In its original state the program writes out a file which
is copied to PRN in binary mode and everything is fine. However I modified
the program to send its output to stdout and use it to pipe output straight
to the printer. I've already changed the mode of stdout to binary inside
the program but the printer still went wrong whenever a 0x1a byte occurred.
As a kludge I've added a test to the output bitmap routine to send 0x18 whenever
it finds a 0x1a so the program basically works .... but (a) a 0x1a could still
occur in a length byte and (b) I'd like to sort this out properly.

So the question basically is this

Is it possible to set up PRN so that

	program | PRN
	
is equivalent to

	program > temfile
	copy /b tempfile PRN
	
when the output from the program is a stream of binary bytes contains what text
mode considers to be EOF markers. 

david shepherd 
non-US: <des@inmos.co.uk>
US:     <des@inmos-c> or possibly <des%inmos-c@"somewhere like uunet.uu.net">