Date: Thu, 4 Feb 1999 18:16:47 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: David Allsopp cc: djgpp AT delorie DOT com Subject: Re: Help needed: reading COM1 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Thu, 4 Feb 1999, David Allsopp wrote: > So, after some research, I've got the latest DJGPP compiler, > and I've started in on the FAQ, which is, of course, huge. If you are looking for a specific topic, use the indices at the end of the FAQ to quickly find out if the topic you are after is at all in the FAQ. Anyway, the FAQ is NOT the place to look for functions you need to use for your program. You need to search the library reference, libc.info. > Could anyone help me short-circuit the process of finding what I want, > please? The program I need to write must: > > Open COM1 (or possibly another COM) and send a character. You can use the preconnected stream called `stdaux'. It is already connected to COM1. > Read a short (~30 char) string from the port. Use `fread'. > Write the string out to a file. Any write function, but pay attention to the binary/text issue. (`stdaux' is in binary mode.) > Time out after 5 seconds if the port (a weighbridge, actually) > doesn't reply. Use `select'.