Getting "Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file" unexpectedly while attempting to create a small log file. Here's some background.
This is a Swift app I wrote for my own use six years ago.
A week ago, I made a small update to the app, which has not been changed in over two years. First time using Xcode 16.4 on this app, which required some code updates of course. The code creating this file has not been changed.
Now for the first time, I'm getting this permissions error on a folder with wide-open permissions.
This is the code. Worked for years under previous versions of Xcode.
*
if let outputURL = URL(string: "file://" + logPath + "/output_" + outputFormatter.string(from:Date()) + ".txt"){
do{
try outputString.write(to: outputURL, atomically:false, encoding: .utf8)
}catch let error as NSError{
print ("log write error (error) (nl) (outputString)")
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Having some problems with launchd since I upgraded to Sonoma.
First some background. I run a secondary userid which is logged in whenever the Mac is turned on. At startup it logs in. It contains a launchd file to run at load & lock the user, in case my Mac falls into the wrong hands. It also contains two launchd files which run an app at load & daily at 2PM.
All the above worked reliably under Ventura.
Focusing on the launch process now. I noticed the app was not starting up at login. Suspected that two launchd run at launch files may be a problem. So, as a test, I renamed (plist > xml) so that only the app would run at launch.
When I tested it. my app did not launch, but the renamed file which locks the id still ran. Strange.
Any insights as to what's happening?
Thanks.
Everything I've found about SUBQUERY has told me about half of what I need to know. Sorry if the following sounds stupid I know the contents portion of SUBQUERY is the name of a propery, either NSARRAY or NSSet. Should the property be allocated & initialized before the query is executed? Should it be somehow populated? Aside from being named in the SUBQUERY argument, how should it be used ? Thanks in advance.