Checking integrity of a Core Data document with SQLite store
Checking integrity of a Core Data document with SQLite store
- Subject: Checking integrity of a Core Data document with SQLite store
- From: Dave Fernandes <email@hidden>
- Date: Sun, 14 Mar 2010 22:21:37 -0400
I recently had a user show me a corrupted document (NSPersistentDocument with SQLite store). The document would open, but then cause problems later on. The initial 10% of the file looks fine, but the remainder is all 0's. I think the corruption occurred while doing a Finder copy from one disk image to another, so I would simply like to detect the corruption before opening the file.
The problem is currently that the file can be opened, but an exception is only thrown when some user action causes a fault to be fetched from a part of the file that is corrupt.
So my question is - how do you detect this before loading the file? I'm aware of the sqlite3 PRAGMA integrity_check, but there does not seem to be a C API for this. Any pointers?
Thanks,
Dave_______________________________________________
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