• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Does NSFileWrapper implement a lazy read?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Does NSFileWrapper implement a lazy read? (From: Todd Heberlein <email@hidden>)

  • Prev by Date: Re: CGEventKeyboardGetUnicodeString + modifier key
  • Next by Date: Re: CGEventKeyboardGetUnicodeString + modifier key
  • Previous by thread: Does NSFileWrapper implement a lazy read?
  • Next by thread: Sorting Array Alphabetically
  • Index(es):
    • Date
    • Thread