home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!mips!darwin.sura.net!mojo.eng.umd.edu!russotto
- From: russotto@eng.umd.edu (Matthew T. Russotto)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Newline mode
- Message-ID: <1992Aug18.220053.14547@eng.umd.edu>
- Date: 18 Aug 92 22:00:53 GMT
- References: <ISBELL.92Aug18131432@pop-tarts.ai.mit.edu>
- Organization: College of Engineering, University of Maryland, College Park
- Lines: 29
-
- In article <ISBELL.92Aug18131432@pop-tarts.ai.mit.edu> isbell@ai.mit.edu (Charles L Isbell) writes:
- >
- >Here's an easy one. Think C. Mac file manager interface (ie FSRead()
- >as opposed to fgets(), etc). I want to read in a line (defined as a
- >string of characters terminated by a newline) at a time. Inside Mac
- >say there's a newline mode that will do this for you automatically,
- >but doesn't explain how to do it. Currently I read in a character at
- >a time until I hit a newline, but I'm sure that's just toooooo slow.
- >
- >So, how do I do this nwline thing (ie implement a fast fgets())?
-
- Believe it or not, newline mode is documented! OK, not documented
- anywhere near its first mention, but it is documented :-)
-
- From the electronic Inside Mac:
- Note: Advanced programmers:Bit 7 of ioPosMode is the newline flag; it's
- set if read operations should terminate at a newline character. The
- ASCII code of the newline character is specified in the high-order
- byte of ioPosMode. If the newline flag is set, the data will be read
- one byte at a time until the newline character is encountered,
- ioReqCount bytes have been read, or the end-of-file is reached. If
- the newline flag is clear, the data will be read one byte at a time
- until ioReqCount bytes have been read or the end-of-file is reached.
-
- --
- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu
- Some news readers expect "Disclaimer:" here.
- Just say NO to police searches and seizures. Make them use force.
- (not responsible for bodily harm resulting from following above advice)
-