• 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: Saving only required files in a file wrapper?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving only required files in a file wrapper?


  • Subject: Re: Saving only required files in a file wrapper?
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 7 May 2008 21:36:05 -0500

On May 7, 2008, at 9:06 PM, Graham Cox wrote:

On 8 May 2008, at 10:26 am, Keith Blount wrote:

The trouble with all of these methods is that they tell you not to rely on fileURL

My interpretation of that advice is that at the time the read... and write... methods are called, the document hasn't set up -fileURL, so in that sense you can't rely on it (i.e. don't call -fileURL from within these methods). But the URL passed to the methods themselves as a parameter is definitely reliable. So provided you use the parameter you'll be fine.

I think it means more than that. NSDocument tries to be smart about atomic writes and backups. The URL passed into the write... methods is not expected to be the same as the document's current location on disk. You are to write the document, in whole, to the temporary location provided to you (about which no assumptions should be made), and then NSDocument will take care of swapping the newly-written document with the old document and deleting the old document.


Obviously, this runs directly counter to Keith's desires. Unfortunately, I don't know how to override these smarts in NSDocument, other than perhaps what I described earlier with NSFileWrapper.

-Ken
_______________________________________________

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


References: 
 >Re: Saving only required files in a file wrapper? (From: Keith Blount <email@hidden>)
 >Re: Saving only required files in a file wrapper? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: find repaint areas?
  • Next by Date: Re: Off Topic: selling a product line
  • Previous by thread: Re: Saving only required files in a file wrapper?
  • Next by thread: Re: Saving only required files in a file wrapper?
  • Index(es):
    • Date
    • Thread