Hello there,
I use Godot 4.0.2-stable on Debian Testing, installed via Flatpak. I'm trying to copy a directory from another directory relative to the executable file into the user:// at runtime. Let's say a have such a structure "local/inner/" right next to the .x86_64/.exe file. What I tried:
To open the outer ("local") folder, I tried:
var dir = DirAccess.open("local/")
, also without the slash, with "./", and even with absolute path.
Then I tried copying the inner folder using:
dir.copy("inner/", "user://inner/")
; again, I tried without the slashes at the end, with "./" at the beginning, and even tried both absolute paths starting with "/home" or "file:///home".
Also, I made an attempt using:
DirAccess.copy_absolute(...)
, of course with absolute paths, but also with "user://".
It seems like neither of these works for me. In order to make sure the Godot editor (and the exported game) actually has access to these directories, I enabled Flatpak full filesystem access and checked permissions for the folder I'm trying to use. Also, I tried standalone (non-Flatpak) Godot from the official website. I have read the Godot Docs on DirAccess, File system, and File paths in Godot projects several times, yet I can't figure out what I am doing wrong.
Wrapping these commands in print()
, I got either 1, 7, or 12 Error codes. Some other operations like make_dir(<path>)
work; dir_exists(<path>)
returns true.
Can anybody help me with this problem? Thank you a lot for your time!