Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!tybalt.caltech.edu!josephc From: josephc@tybalt.caltech.edu (Joseph I. Chiu) Newsgroups: comp.sys.ibm.pc Subject: Re: HELP! MS-DOS interception of data to PRN Keywords: printer MS DOS MS-DOS code intercept help Message-ID: <1990May4.235545.5569@laguna.ccsf.caltech.edu> Date: 4 May 90 23:55:45 GMT References: <1990May4.054639.19766@laguna.ccsf.caltech.edu> Sender: news@laguna.ccsf.caltech.edu Distribution: comp Organization: California Institute of Technology Lines: 37 This is a preliminary followup to my article asking for help with the way MS-DOS intercepts a EOF going to the printer. First, thanks to those of you who have started sending suggestions. A few people mentioned that the FILE stream had to be opened as a binary stream. That is, in fact, the way I have been running it. It works almost perfectly EXCEPT for the fact that it intercepts a EOF character. By the way, most C implementations open the stdprn as a binary stream, so that wasn't it. ( By the way, it is almost always a good idea to freopen the three std-streams. That way, you can redirect your programs' output to a file as an added bonus!) A few more people mentioned COPYing the file to the printer. Most were quick to point out that you had to use COPY /B FILE PRN. THIS WORKS. (I was thinking about COPY, but I forgot all about the /B, so I had gibberish there, too). Finally, someone mentioned using the ioctl function. Hmmm.. Seems to me, from what information I have currently, it would work. I'll try it and give you guys a holler later about this... The gist of it is that you have to tell DOS to stop treating the PRN device in "cooked mode". Thanks guys. I LOVE the net... You are wonderful. (Try getting this fast support/service with Borland or Microsoft... Ugh.) -Joseph ------------------------------------------------------------------------------- I wish I was somewhere else, walking down a strange new street... Hearing words that I have never heard before, from a girl I've yet to meet... - It Might As Well Be Spring (Rodgers & Hammerstein II) ------------------------------------------------------------------------------- JosephC @ Romeo.Caltech.Edu My opinions, all mine, and you can't have them! -------------------------------------------------------------------------------