Search Issue Tracker
Fixed in 4.5.5
Votes
0
Found in
4.3.4f1
Issue ID
589686
Regression
No
Application.persistentDataPath is not correct for OSX
To reproduce:
1. Create a new project
2. Create a new script
3. Add Debug.Log(Application.persistentDataPath); to the Start() function
4. Attach the script to the main camera
See that the path is /Users/<UserName>/Library/Caches/<CompanyName>/<ApplicationName>/ when it should be /Users/<UserName>/Library/Application Support/<ApplicationName>/
Reasoning:
/Users/<UserName>/Library/Caches is not an appropriate to store persistent data and users either themselves or with existing disk cleanup tools routinely clear the contents of the ~/Library/Caches/ directory and blow away user generated files or save game files etc. The ~/Library/Caches is intended for files that only need temporary persistence, hence the name "Caches". Besides, Unity already provides another path for temporary data in the existing Application.temporaryCachePath variable that developers should probably use for truly temporary cache data.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
shubhamswaraj2021
Aug 20, 2020 01:53
good one <a href="https://www.lyricsauto.com">lyricsauto</a>
davekalina
Feb 17, 2015 19:43
It appears that if you have existing save data in /Caches, it will continue to use that folder as your "persistentDataPath" even though it isn't remotely persistent, and it won't migrate your data to a better/safer location, even though that would be the right thing to do.
I suppose one could log that as a separate bug.
HoMeBoYErik
Nov 17, 2014 11:03
I think this bug is showing again in Unity 4.5.5p5.
In Debug.Log the persistentDatapath is written as :
/Users/<username>/Library/Caches/<Company Name>/<Product Name>/
but
at runtime it writes to
/Users/<UserName>/Library/Application Support/<CompanyName>/<ApplicationName>/
So I have a couple of Plugins (like Acid NoSQL Data Storage that fails to initialize the files)
PAHeartBeat
Oct 28, 2014 13:13
its has been solved in Unity 4.5.5P1, you can find it bellow given location, if you give name of company then you have to check 2nd path.
/Users/<UserName>/Library/Application Support/<ApplicationName>/
/Users/<UserName>/Library/Application Support/<CompanyName>/<ApplicationName>/
Deozaan
Sep 12, 2014 18:21
This is still an issue as of Unity 4.6 beta 18.
xpkoalz
May 31, 2014 14:09
sorry, have hidden my "library" folder..
xpkoalz
May 31, 2014 13:54
I still can't find my saved file on my mac, thing is there is no Library folder inside ~ /Users/<UserName>...and I tried searching everywhere else with the folder name Library, there's no file name <ApplicationName>/*test.dat* ...what is going on?