The material in the url(for:in:appropriateFor:create:) docs provided the solution. The file permission problem was caused by the temporary file wrapper being in the same folder as the published book, The solution is to create a temporary directory for the file wrapper. Here's the code for anyone else who may have the same problem in the future.
var wrapperURL = URL(string: "/")
do {
wrapperURL = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask,
appropriateFor: nil, create: true)
wrapperURL?.appendPathComponent("TempBook")
} catch {
Swift.print("Error creating a temporary URL for the file wrapper. Error: \(error)")
}
Topic:
Code Signing
SubTopic:
General
Tags: