Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!mit-eddie!genrad!decvax!tektronix!uw-beaver!ssc-vax!uvicctr!sbanner1 From: sbanner1@uvicctr.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Need help with MS-DOS 3.1 and C Message-ID: <227@uvicctr.UUCP> Date: Sat, 14-Feb-87 21:09:47 EST Article-I.D.: uvicctr.227 Posted: Sat Feb 14 21:09:47 1987 Date-Received: Sun, 15-Feb-87 16:03:47 EST References: <784@cald80.UUCP> <174200030@uxc.cso.uiuc.edu> Reply-To: sbanner1@uvicctr.UUCP (S. John Banner) Organization: University of Victoria, Victoria B.C. Canada Lines: 40 In article <174200030@uxc.cso.uiuc.edu> crimmins@uxc.cso.uiuc.edu writes: > >/* Written 11:38 am Feb 5, 1987 by bob@cald80.UUCP in uxc.cso.uiuc.edu:comp.sys.ibm.pc */ >>In article <3281@hplabs.hplabs.UUCP> drichard@hplabs.UUCP (Dave Richards) writes: >>> >>>putc()ing characters to a stream that was successfully opened via >>>fopen() for "w" access to "COM1". I check the returned pointer for NULL >>>and guaranteed fopen()s success. However, after writing BUFSIZ >>>...much deleted for Pnews >>> Dave Richards at Hewlett-Packard Labs (drichard@hplabs) >> >>I have found that fopen()ing a file causes the system to assume that >>you are going to send text to it. It usually turns on ^Z mapping to >>end of file. It also does \n to \r\n mapping. Needless to say, you >>can't pump binary to it. > >I'm not sure about aztec or desmet, but most of the C compilers I've >used (including MSC) give you the option of opening the file in >binary mode by appending a b to the mode (i.e. fopen("file","wb");). > >>Try to use open() on COM1 and see if that has any better success. > >With MSC, there are 5 predefined stream pointers...stdin, stdout, >stderr, stdaux (COM1:), and stdprn (LPT1:). No opening is >necessary...just write to the appropriate stream. This is all >documented completely in the manuals. Yes, but what if you want to read binary from stdin, and write binary to stdout??? S. John Banner ...!{uw-beaver,ubc-vision}!uvicctr!sbanner1 ccsjb@uvvm sbanner1@uvunix.UVIC.CDN #1 1121 Fort St. Victoria BC. Canada V8V 3K9