0

I'm using the following code to to consolidate my Core Data sqlite store files, which current consists of the database itself, a -wal and a -shm file. I am doing this so I can manipulate it as a single file using NSFileManager.

NSPersistentStoreCoordinator *tmpPSC = [[NSPersistentStoreCoordinator alloc] 
      initWithManagedObjectModel...];

NSDictionary *options = @{NSSQLitePragmasOption: 
                        @{@"journal_mode": @"DELETE"}};

NSPersistentStore *persistentStore = [tmpPSC 
   addPersistentStoreWithType:NSSQLiteStoreType configuration:nil 
   URL:storeURL options:options error:NULL];

if (persistentStore) {
   [tmpPSC removePersistentStore:persistentStore error:NULL];
   tmpPSC = nil;
}

However, after the above code execute, I am seeing the -wal file disappear, but the -shm file is still there.

Any idea why this is so?

Eric
  • 1,858
  • 2
  • 16
  • 17

1 Answers1

0

Never mind, found my answer here:

How to save the content of a MOC to a file, with no -wal and no -shm?

shm file can safely be deleted, which is what I did.

Community
  • 1
  • 1
Eric
  • 1,858
  • 2
  • 16
  • 17