Path of Application.persistentDataPath on Linux?

Hey there!

The internet wasn’t able to tell me where Unity’s Application.persistentDataPath points to on Linux, so I figured asking about that here. I’d love to make my save games on Linux compatible with Steam’s Auto-Cloud for which I have the following options:

LinuxHome/[Company]/[ProjectName]
LinuxXdgDataHome/[Company]/[ProjectName]

Any ideas where Application.persistentDataPath points to on Linux?

persistentDataPath is $XDG_CONFIG_HOME/unity3d/Company/ProjectName (XDG_CONFIG_HOME defaults to ~/.config)

You can get XDG_DATA_HOME (or its default of ~/.local/share) by calling Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

So I should probably fill in the following in Steam Auto-Cloud, right?

[LinuxXdgDataHome]/unity3d/[Company]/[ProjectName]

FWIW: Steam’s documentation states that LinuxXdgDataHome points to $XDG_DATA_HOME/ or $HOME/.local/share/.

I guess, [LinuxXdgConfigHome].

After a bunch of testing, apparently [LinuxHome] was the right one, leading to: .config/unity3d/CompanyName/GameName

3 Likes

This is nearly cheating, but mind if I ask what you ended up with for the entirety of your auto-cloud config? =D

Or really, the Linux one specifically is the one I’m hoping to avoid doing a full 1/2 day+ of rebooting into various distros in order to test.

Thanks in advance either way – I know how ‘fun’ this trial & error stuff is, figured worth a shot to ask. :slight_smile:

My save files end with ‘.data’, hence the pattern.

10 Likes

Ah, that’s awesome – thank you, can’t thank you enough! =D

If there’s ever anything we can do for you shoot us a message! :slight_smile:

home/.config/unity3d/DefaultCompany/[project]

Sorry to up this topic but it could be great to update the docs to reflect this.

1 Like

Yeah the docs are just totally wrong for Linux. (Classic!)

i am having an error (UnauthorizedAccessException: Access to the path ‘C:\Users\UmaradilAzar\AppData\LocalLow\Runner\RunnerUI’ is denied)
is anyone have an idea how to get permission for linux ?

That path does not exist on Linux. It’s not a permission problem, you are just getting an invalid path.

1 Like

At the moment am working on windows, it is not giving me permission for persistent datapath, later on i would switch the build for linux

I’m having trouble using SteamCloud on Linux. PersistentDataPath is giving me the following path:

/home/cezar/snap/steam/common/.config/unity3d/Green Sauce Games/Hope’s Farm 2

What’s wrong with this path? If you installed Steam through Snap this is the path you should get.

So how should you setup steam cloud if unity’s persistentDataPath is different for snap installation of steam? Or does the setup above already cover this difference?