Godot version
3.x at 5600be9
System information
Arch Linux
Issue description
On certain paths where a file exist, File.file_exists and Directory.file_exists return false depending on what filesystem is being accessed.
Even when the file exists, in line 183 below, Map<PathMD5, PackedFile>.find does not seem to work properly since it returns a null value.
|
FileAccess *PackedData::try_open_path(const String &p_path) { |
|
PathMD5 pmd5(p_path.md5_buffer()); |
|
Map<PathMD5, PackedFile>::Element *E = files.find(pmd5); |
|
if (!E) { |
|
return nullptr; //not found |
|
} |
The md5 path hashing and finding does not seem to work as expected.
Related Issues:
Steps to reproduce
- Decompress file_exists_bug.zip and open with the Editor and run the project. You'll see the following output:
Checking path with res://
Path: res://autoload/singleton_manager/singletons/engine_data_forwarder_manager/forward_engine_data_node.gd
File.file_exists: True
Directory.file_exists: True
load() check: [GDScript:1269]
Checking path without res://
Path: autoload/singleton_manager/singletons/engine_data_forwarder_manager/forward_engine_data_node.gd
File.file_exists: True
Directory.file_exists: True
load() check: [GDScript:1272]
- Decompress file_exists_bug_export.pck.zip and open with
godot --main-pack file_exists_bug_export.pck
And you'll get the following output -- note that File.file_exists and Directory.file_exists return false but Godot is still able to load the resource:
Checking path with res://
Path: res://autoload/singleton_manager/singletons/engine_data_forwarder_manager/forward_engine_data_node.gd
File.file_exists: False
Directory.file_exists: False
load() check: [GDScript:1266]
Checking path without res://
Path: autoload/singleton_manager/singletons/engine_data_forwarder_manager/forward_engine_data_node.gd
File.file_exists: False
Directory.file_exists: False
load() check: [GDScript:1269]
Minimal reproduction project
file_exists_bug.zip
file_exists_bug_export.pck.zip
Godot version
3.x at 5600be9
System information
Arch Linux
Issue description
On certain paths where a file exist,
File.file_existsandDirectory.file_existsreturn false depending on what filesystem is being accessed.Even when the file exists, in line 183 below,
Map<PathMD5, PackedFile>.finddoes not seem to work properly since it returns a null value.godot/core/io/file_access_pack.h
Lines 181 to 186 in 5600be9
The md5 path hashing and finding does not seem to work as expected.
Related Issues:
Directorydir_existsfails on exported projects on subpaths & paths with more than 2 slashes inres` #37646Steps to reproduce
And you'll get the following output -- note that
File.file_existsandDirectory.file_existsreturn false but Godot is still able to load the resource:Minimal reproduction project
file_exists_bug.zip
file_exists_bug_export.pck.zip