Godot version:
Godot 3.1 Beta 5
OS/device including version:
Manjaro Linux - Kernel 4.19
Issue description:
So, I have a function that read files in a specific directory.
For save guarding, I use Directory.dir_exists(path)
This works fine when running the project in editor, however, when exporting it, dir_exists returns false, even if the directory exists. If I remove this safe guard and export, the files get loaded properly.
Steps to reproduce:
.txt to the exported files, since the texts are read out of TXT files.Loader: failed to load res://texts, return [] (dir_exists).if not directory.dir_exists(path):
print("Loader: failed to load ", path, ", return [] (dir_exists)")
return []
from res://reader/Reader.gd
Minimal reproduction project:
test.zip
I can confirm this problem. Works in the editor, but fails in exported programs.
This is still present in Godot V3.1 stable!
This is also present under Windows 10 operating system.
Note that directory.file_exists(path) still works correctly.
Reproducible in Ubuntu 18.04, Using latest master
I found the issue, working on a proper fix.
Until the fix is included in a stable release, you can work around the issue by simply removing the "res://" prefix from your path.
I've been experiencing this bug in custom builds of mine, which were just 3.2 beta 5, and the master branch 3.2.2 + Zylann's voxel module.
@TheMisteryMan Please open a new bug report with a reproduction project, this one has been fixed so the bug you experienced might be different.
Most helpful comment
I found the issue, working on a proper fix.