Re: [Q] large flat files usage
Re: [Q] large flat files usage
- Subject: Re: [Q] large flat files usage
- From: Cameron Hayne <email@hidden>
- Date: Thu, 20 Jun 2002 02:06:29 -0400
Douglas Davidson <email@hidden> wrote:
On Wednesday, June 19, 2002, at 04:44 PM, Phillip Morelock wrote:
I'm leaning toward writing the first go-round as read-only, so I don't
even
have to deal with reupdating indices and inserting changes into the
middle
of flat files until I absolutely am required to.
Read-only for 10M is easy--just map it. Use +[NSData
dataWithContentsOfMappedFile:], and let the buffer cache do your work
for you.
You could use the same technique even if you decided to allow writing of
the file by using
+NSMutableData dataWithContentsOfMappedFile:
Of course, it would be best in this case if the records in the file were
of fixed size to keep things simple.
... Cameron
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.