OS X application, Yosemite (host and target), Xcode 6.1, all-Swift. If you 
duplicate (save-as) an existing document, the new document appears on disk with 
external journaling files (SHM, WAL).

It is impossible to state how undesirable this is without descending into 
sarcasm.

The solutions I’ve seen from a web search are a year or more old, and have 
proven ineffective.

What is the current thinking on this? This is another of those things that are 
so conspicuous that I must be missing something obvious.

Details below the fold.

        — F


This concern seems to have been perking along since the introduction of 
Mavericks.

One commenter said DTS volunteered these solutions:

1. Continue to use the Mountain Lion SDK for Mavericks development.

2. Swizzle something. I stopped reading.

Time’s run out on those.

A year ago, it was suggested on this list that the persistent-document subclass 
should override the method for which the Swift signature is:

configurePersistentStoreCoordinatorForURL(_: NSURL!,
        ofType: String!,
        modelConfiguration: String?,
        storeOptions: [NSObject : AnyObject]!,
        error: NSErrorPointer) -> Bool

… and pass @{ NSSQLitePragmasOption : @{ @"journal_mode" : @"DELETE" } } as 
storeOptions: to super. With that pragma set, SQLite is supposed to suppress 
the journal files.

An account of the strong-typing nightmare would veer once again into sarcasm. 
I’m unhappy about assuming storeOptions will always be nil.

Here is my attempt:

```
let newOpts = [NSSQLitePragmasOption : ["journal_mode" : "DELETE"]]

// Also suggested:
// let newOpts = ["JOURNAL":"DELETE"]
// This doesn’t work, either.

return super.configurePersistentStoreCoordinatorForURL(url, 
           ofType: fileType,        modelConfiguration: configuration,
           storeOptions: newOpts, error: error)
```

The breakpoint at the return line fires. newOpts has the expected content. I 
still get WAL and SHM files. Using … ["journal_mode" : "OFF"]] does no better.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to