Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!inuxc!pur-ee!uiucdcs!uxc.cso.uiuc.edu!crimmins From: crimmins@uxc.cso.uiuc.edu.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Need help with MS-DOS 3.1 and C Message-ID: <174200030@uxc.cso.uiuc.edu> Date: Mon, 9-Feb-87 11:43:00 EST Article-I.D.: uxc.174200030 Posted: Mon Feb 9 11:43:00 1987 Date-Received: Wed, 11-Feb-87 18:40:23 EST References: <784@cald80.UUCP> Lines: 38 Nf-ID: #R:cald80.UUCP:784:uxc.cso.uiuc.edu:174200030:000:1510 Nf-From: uxc.cso.uiuc.edu!crimmins Feb 9 10:43:00 1987 /* 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. > Bob Meyer > Calspan ATC ---- Dan Crimmins University of Illinois at Urbana-Champaign Computing Services Office - Micro Consulting Dept. ARPA: crimmins@uiucuxc.cso.uiuc.edu BITNET: crimmins@uiucuxc.bitnet CSNET: crimmins@uiucuxc.csnet UUCP: {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!crimmins