Deep sleep and file wrappers?
Deep sleep and file wrappers?
- Subject: Deep sleep and file wrappers?
- From: Keith Blount <email@hidden>
- Date: Tue, 6 May 2008 11:27:09 -0700 (PDT)
Hi,
I have an application that saves its information as a file package. My NSDocument subclass overrides -saveDocument: to save individual files within the project folder (because there can be hundreds of files and I wouldn't want to save the whole file wrapper every time a single file is changed). It overrides -readFromURL:... to load in data from the project package that is initially required, and then other files are only loaded as and when needed. All of which works very well.
A couple of months ago, I posted about a data loss issue two users had had:
http://www.cocoabuilder.com/archive/message/cocoa/2008/2/19/199368
I never got to the bottom of the issue, and now another user has reported the same thing. To recap: whilst my app was open, the user's computer went into deep sleep (this was the case with the first two users; the third user cannot remember the exact circumstances but says his computer has had deep sleep problems recently). When it came out of deep sleep, everything in the project's file wrapper - that is, everything in the folder-with-extension on disk - had been wiped. All that was in there were the few files that were auto-saved _after_ deep sleep.
There is nothing in my app that would go through and delete everything in this manner - or at least, nothing obvious that I've done. Instead, it seems that during deep sleep something happens whereby the whole file package gets replaced/overwritten with a blank one. But again, I don't know how this could be as I never, ever write out the whole wrapper - only individual documents get written inside the wrapper in the -saveDocument: method.
So, my question is: is there anything that can happen during deep sleep that could make an NSDocument overwrite itself? Is there anything in the document architecture that could cause this when working with packages?
I'm really at a loss on this. Fortunately, as I know of, this has only happened to three of thousands of users. But three is still too many when it comes to data loss, obviously. Many thanks in advance for any advice or suggestions on where to start digging.
All the best,
Keith
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________
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