Re: Reading text files line-by-line (dead link from archive)
Re: Reading text files line-by-line (dead link from archive)
- Subject: Re: Reading text files line-by-line (dead link from archive)
- From: "Daniel Dickison" <email@hidden>
- Date: Wed, 29 Aug 2007 07:57:07 -0400
On 8/28/07, Oleg Kibirev <email@hidden> wrote:
> You can just use plain old fdopen and fgets if your lines are of a
> reasonable size. Otherwise you can mmap a few megs of the file at a
> time and use memchr(ptr, '\n', len) to look for newlines in the
> mapped area.
>
I think fdopen and fgets will work. Fortunately I don't need to read
in classic Mac OS text files (with '\r' EOLs) which I presume would
not work with fgets.
I haven't worked too much with plain C so I wasn't familiar with these
functions. Thanks for the tip!
Daniel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden