Re: NSFileWrapper
Re: NSFileWrapper
- Subject: Re: NSFileWrapper
- From: Markus Spoettl <email@hidden>
- Date: Sat, 04 Jun 2016 23:10:06 +0200
On 04/06/16 18:42, Jens Alfke wrote:
I wouldn’t recommend NSFileWrapper for large files, because it reads all of a
file into memory.
I find this comment to be very misleading.
Part of the reason why packages are so great (apart from being supported by
NSDocument/AppKit as a method to store document data) is because you can
partition the data into many many files. If you have data that's too big, split
it up into multiple files. And what is large anyway?
When you open such a package document, NONE of the individual file's contents
are read, you have complete control over what individual file you read and when.
Likewise with saving, you never have to store everything from scratch (you can,
but you don't have to). If you have unchanged data you just let the API know (by
reusing the wrappers you got when the file was opened).
I'm a fan.
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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