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

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

Reply via email to