/usr/share

I need to create a folder accessible from all users and create/write some file inside it.

UnityEngine.Application.dataPath seems the right choice but if you put the application in applications menu it became read only.

With System.Environment.SpecialFolder.CommonApplicationData I found the folder /usr/share but it’s read only. I changed permission to enable everyone to write in it but I don’t know if it’s “correct”.

Where can I write application’s files?
How can I make an installer to create a directory and change owner/permission?

Thanks

You probably want to put things like that in a folder in /Users/Shared, as this location is writeable by all users by default. You’ll notice that OTEE use it to store their example project. Although /usr/share has a similar name, it isn’t something you should use for this purpose, and I think that Mono is wrong to relate SpecialFolder.CommonApplicationData to it on OSX.

As far as I can see, there’s no way to get /Users/Shared with Environment.GetFolderPath(), so you’ll presumably have to construct the path yourself.

You could also create a world-writeable folder in /Library/Application Support. This might be more appropriate if the data file you’re writing isn’t supposed to be directly handled by the user.

Thanks Neil!