Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!spdcc!merk!alliant!linus!philabs!crpmks!billb From: billb@crpmks.UUCP (Bill Bochnik ) Newsgroups: comp.sys.ibm.pc Subject: Re: How come I can't send ^Z through LPT1: ? Message-ID: <1142@crpmks.UUCP> Date: 27 Mar 90 04:21:16 GMT References: <1174@ndcheg.cheg.nd.edu> Reply-To: billb@crpmks.UUCP (Bill Bochnik (Info Systems)) Distribution: na Organization: Ciba-Geigy Corporation Lines: 34 Summary: Expires: Sender: Followup-To: Keywords: In article <1174@ndcheg.cheg.nd.edu> kellow@ndcheg.cheg.nd.edu (John Kellow) writes: > >I've come across an unexpected problem. I wrote a program on a Sun >that would print a color image on the inkjet printer connected to my >PC, so the output file is basically binary image data with some escape >sequences thrown in. I transferred the output over to the PC and then >tried to print it using print (i.e. print foo.bar). The first few >lines printed fine, then it stopped. I tried 'copy foo.bar prn:' (and >lpt1:), and it did the same thing. After spending a lot of time >going through hex dumps, I realized things were getting messed up >where there was a ^Z character. When I changed it to something >else, then the file printed fine. But I shouldn't have to do this - >if the data happens to be a ^Z, then its a ^Z. So how can I properly >send a binary file to the printer? > Yes, as far as I remember, ^Z is the DOS standard end of file marker for text files and the ilk. The problem is that DOS sees the eof marker and terminates the print or copy to printer command before it has a chance to finish. What you need is to get around the eof problem. The standard way is like this: COPY filename.ext LPT1: /B The /b qualifier tells DOS to copy the file as is, until the length of the file signifies that we are at the end. It copys the file as (B)inary, ignoring the eof marker as it goes. This little workaround should solve your problem. I think that the switch is in the DOS manual (but who reads them anyway) but of course an explaination of its uses is useless at best. Good luck.