home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!cc935
- From: cc935@cleveland.Freenet.Edu (Gerrold T. Sithe)
- Newsgroups: comp.os.linux
- Subject: How read characters from /dev/modem/ using C?
- Date: 13 Dec 1992 22:07:02 GMT
- Organization: Case Western Reserve University, Cleveland, Ohio (USA)
- Lines: 18
- Message-ID: <1ggc66INNafl@usenet.INS.CWRU.Edu>
- NNTP-Posting-Host: hela.ins.cwru.edu
-
-
-
- I'm trying to write a C program that executes a chat script with a
- dialup system. I run my program with input and output redirected to the modem:
-
- a.out </dev/modem >/dev/modem
-
- Using scanf to read from the modem doesn't work well because the remote
- system doesn't end it's query lines with a newline. So the prompt, "Enter
- Command?" doesn't get received until later. No good for a chat script.
-
- So I went to a character based input using getchar. Still the modem
- driver won't return a line of data until it receives a newline from the remote
- system. I then tried using the system IO calls open and read with no success.
-
- How can I access the modem on a character-by-character basis or have it
- return lines without receiving a newline?
-
-