Re: Does NSFileWrapper implement a lazy read?
Re: Does NSFileWrapper implement a lazy read?
- Subject: Re: Does NSFileWrapper implement a lazy read?
- From: Charles Srstka <email@hidden>
- Date: Sun, 15 Apr 2007 14:06:01 -0500
On Apr 12, 2007, at 10:32 PM, Todd Heberlein wrote:
I have an NSDocument subclass that implements
readFromFileWrapper:ofType:error: method. The document is a bundle
document, and I expect one of the files in the directory to become
very large (e.g., 1 Gig). Furthermore, I never need to read this
entire file into memory (I scan it for certain information).
When readFromFileWrapper is called, does the NSFileWrapper that is
passed in already have all the data from the bundle directory in
memory (i.e., will that 1 Gig data file be in memory), or is it
only read in when I pass the appropriate sub-NSFileWrapper the
regularFileContents method? (which in the case of the large file,
I will never do).
Thanks,
Todd
I don't think it does. Your best bet is probably to implement
readFromURL:ofType:error: instead of
readFromFileWrapper:ofType:error: if you don't want to load the
entire document into RAM.
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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