/Applications is owned by root, and has rwx privileges only for the system, and 
rx for group (admin) and all. This means you will need to have your installer 
(with root privileges) to create your company/application directory inside. 
As an alternative, you can certainly place your directory in /Users/Shared. 
That directory has rwx privileges for everyone. I believe it also has the 
sticky bit set, which means that the “user” that created the file(s) must be 
the one to delete them.

Both are good places to put things that must be shared among multiple users. 
Note that ~/Library/Application Support is not a good place for sharing things 
since it is not accessible by anyone but the ~ user.

Jack



> On Apr 14, 2021, at 11:26 AM, Marco S Hyman via Cocoa-dev 
> <cocoa-dev@lists.apple.com> wrote:
> 
> 
>> Our app isn't sandboxed, but when I try to create a "/Library/Application 
>> Support/NewFolder" folder in there I get the following message:
>> 
>> /*You don't have permission to save the file "NewFolder" in the folder 
>> "Application Support."*/
> 
> Yup.  You want ~/Library/Application Support/NewFolder for per user files.  
> Use FileManager.  In swift something like
> 
> let fileManager = FileManager.default
> let supportDir = fileManager.url(for: .applicationSupportDirectory,
>                                 in: .userDomainMask,
>                                 appropriateFor: nil,
>                                 create: true)
> 
> that creates the app support directory for your app.  You can then append 
> NewFolder to the resulting URL and create it.
> 
> I *think* (never used it, might be wrong) if you replace .userDomainMask with 
> .localDomainMask you will get a URL available to all users on the local 
> machine.
> 
> There may be other options that are better suited to your use.
> _______________________________________________
> 
> 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/jackbrindle%40me.com
> 
> This email sent to jackbrin...@me.com

_______________________________________________

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