On Sun, Nov 30, 2008 at 12:48:26AM -0800, Andrew Farmer wrote: > On 29 Nov 08, at 14:23, Nick Zitzmann wrote: >> On Nov 29, 2008, at 5:39 AM, Mudi Dandan wrote: >>> Is it possible to to display a memory mapped file in an NSTextView >> >> Of course. > > With one caveat: When creating a memory mapping (by using mmap), you > have to specify the length of the region you want to map - so, if the > file grows, you have to remap the file. Detecting this is up to you; > kqueue may be useful in doing so. Also, if the file gets really large*, > it may fail to map at all on 32-bit systems, as there's a limited amount > of address space available. > > Unless you're absolutely sure that memory-mapping files is crucial to > your application's performance, try just using standard file descriptors > first. The performance difference isn't that huge, and there are a lot > fewer caveats** involved.
If you want an example of how this mapping is done, check out the sources for HexFiend: <http://ridiculousfish.com/hexfiend/> -Ben _______________________________________________ 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 [EMAIL PROTECTED]