Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!csn!tramp.Colorado.EDU!gordon From: gordon@news.colorado.edu (GORDON ALLEN R) Newsgroups: comp.lang.c Subject: Re: Problem in opening COM1: Keywords: msdos COM1 serial port Message-ID: Date: 20 Feb 91 16:16:04 GMT References: <5205@vela.acs.oakland.edu> Sender: news@csn.org (news) Reply-To: gordon@tramp.Colorado.EDU Organization: University of Colorado, Boulder Lines: 37 Nntp-Posting-Host: tramp.colorado.edu panguyen@vela.acs.oakland.edu (panguyen) writes: >#include >main() >{ > fopen( "COM1", "r+" ); > fprintf( "CHN %d \r", 3 ); >} >This will cough back at me with the following errors, > Write fault error writing device COM1 > Abort, Retry, Ignore ? You can refer to the following for help with serial communications: The C Toolbox by Hunt, 1986 Supercharging C with Assembly Language by Chesley and Waite, 1987 C Asynch Manager software by Blaise Publ There is another rather large volume on serial communications with C, but I don't remember the name. Briefly, fopen() works for files not devices, as far as I know, in MS-DOS based systems. -- Allen Gordon University of Colorado, Boulder gordon@tramp.colorado.edu gordon_A@cubldr.colorado.edu -- Allen Gordon University of Colorado, Boulder gordon@tramp.colorado.edu gordon_A@cubldr.colorado.edu