Mail Archives: djgpp/1999/02/04/15:42:42
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'.
- Raw text -