Re: Read lines from very large text file
Re: Read lines from very large text file
- Subject: Re: Read lines from very large text file
- From: Michael Ash <email@hidden>
- Date: Sat, 7 Feb 2009 08:05:05 -0500
On Sat, Feb 7, 2009 at 7:57 AM, René v Amerongen <email@hidden> wrote:
>>
>>
>> Thus the warning: if a file disappears while you have it memory
>> mapped, and you try to access it, you will crash.
>>
>
> Does this mean that we should check every time the existence of the file
> before we try to read anything from the memory mapped file?
That would not be useful. The file could go away in between your check
and your read.
You should only memory map files that are on a filesystem that you can
reasonably expect will stay around. Internal hard drives, in other
words. Avoid memory mapping files in arbitrary locations. If you must
do it, map them, read them, and then be done with them as quickly as
you can to minimize the window of opportunity.
Mike
_______________________________________________
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