You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to save plist file in global agent by changing userDomainMask -> localDomainMask let library = try FileManager.default.url(for: .libraryDirectory, in: .localDomainMask, appropriateFor: nil, create: false)
then i got error in macOS Ventura 13.2.1
Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “com.test.plist” in the folder “LaunchAgents”." UserInfo={NSFilePath=/Library/LaunchAgents/com.test.plist, NSUnderlyingError=0x600000d4b870 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
***Note that my application built with sandbox is off.
Do you have any idea?
Thanks
The text was updated successfully, but these errors were encountered:
@trinhtran-markany
I'm just coming by, but I don't think you have the permission to write to /Library as a normal user (you might need sudo or something like that). Hope this helps!
Hi @trinhtran-markany, I somehow missed when you originally opened the issue, but as mentioned even without being sandboxed you can't write to system directories. I believe you need to create a helper tool which actually writes the data that then gets called with elevated privileges.
Hi,
I tried to save plist file in global agent by changing userDomainMask -> localDomainMask
let library = try FileManager.default.url(for: .libraryDirectory, in: .localDomainMask, appropriateFor: nil, create: false)
then i got error in macOS Ventura 13.2.1
Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “com.test.plist” in the folder “LaunchAgents”." UserInfo={NSFilePath=/Library/LaunchAgents/com.test.plist, NSUnderlyingError=0x600000d4b870 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
***Note that my application built with sandbox is off.
Do you have any idea?
Thanks
The text was updated successfully, but these errors were encountered: