How can I access the user data path in C#? File.ReadAllText("user://foo/bar.txt") doesn't resolve properly.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By nightblade9

In GDscript, I can write save files to user://foo/bar.txt, and they show up in the appropriate location. For C#/Mono builds, how do I access this path?

:bust_in_silhouette: Reply From: nightblade9

Turns out there’s an (undocumented?) API for this: Godot.ProjectSettings.GlobalizePath("res://foo/bar.txt") resolves to the proper location.

Courtesy of someone helpful on the Godot Discord.