On Sat, Feb 7, 2009 at 7:57 AM, René v Amerongen <apple...@xs4all.nl> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to