WRITE/READ files to/from "user://" path unsuccessful. Any idea?

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

WRITE/READ files to/from “user://…” path unsuccessful.

Using “res://…” works fine in Godot (so the code is correct) but once it’s exported to Android device, it doesn’t return value. I replaced it with “user://…” as recommended, still no success. Any idea why?

Thank you for your time!

I’m successfully reading/writing on Android using user://savedata.txt (for example). So, I assume the problem must be in your code. Can you post the read/write code?

jgodfrey | 2020-12-27 21:58

Thank you for your reply! I changed user://name.save to user://name.txt and it worked! The reason why I used .savewas because it said so in this link https://kidscancode.org/godot_recipes/basics/file_io/

Oddly enough .save actually worked just fine on my desktop. Anyway, problem solved, huge thanks!

Suleymanov | 2020-12-27 22:21

By the way, where is the location of user:// in desktop? I checked “c/users/user”, the saved file is not there. Must be somewhere else?

Suleymanov | 2020-12-27 22:31

On Windows, it’s here:

C:\Users\<user>\AppData\Roaming\Godot\app_userdata\<game_name>\<your_save_file>

jgodfrey | 2020-12-27 22:34

Additionally, the difference between a .save and a .txt extension shouldn’t matter at all. In fact, I just verified that my save works as expected using savedata.save

jgodfrey | 2020-12-27 22:40

Hmm… That’s interesting. I’ll try it in more android devices with .save and see if it works.

Suleymanov | 2020-12-27 22:48