Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diraccess has problems with accessing files when exported #99047

Closed
BrianBHuynh opened this issue Nov 11, 2024 · 3 comments
Closed

Diraccess has problems with accessing files when exported #99047

BrianBHuynh opened this issue Nov 11, 2024 · 3 comments

Comments

@BrianBHuynh
Copy link
Contributor

Tested versions

  • Reproducible Godot v4.3.stable

System information

Godot v4.3.stable - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4070 Ti (NVIDIA; 32.0.15.6094) - 13th Gen Intel(R) Core(TM) i7-13700K (24 Threads)

Issue description

Diraccess seems to have a few problems with accessing files once exported, this has been observed to happen when trying to get the name of files within a directory. In my main project I can use get_files_at() to get the names of all the files in a directory, however once trying to do that in the export it only exports part of 3 file names.

In the minimum reproducible project on 4.3 stable, the folder is not found at all

image
image

Steps to reproduce

Diraccess get files at --> folder

then export

either the folder won't be found or the file names listed will be incomplete

Minimal reproduction project (MRP)

newGameProject.zip

@BrianBHuynh
Copy link
Contributor Author

This is what it looks like in my current project in the editor:
image

and this is what it looks like in the windows exported console
image

Note how the file name is just cutoff for opendyslexic-regular.otf.imp

@addmix
Copy link
Contributor

addmix commented Nov 11, 2024

the res:// filesystem is imported/converted into godot internal format during the export process.
.import files contain the mapping information of the source file path to the imported internal file (imported files are .scn for scenes, .ctex for textures).

You should be able to load data from the .import files using ConfigFiles, reading the [deps]: source_file string, which you can then pass to load(). You might also be able to load the [remap]: path or UID instead. Though, more easily being able to explore/dynamically load items in folders at runtime is a very useful feature.

I know there are at least a couple other issues and proposals relating to the exported project filesystem, but I can't seem to find them.

@BrianBHuynh
Copy link
Contributor Author

Thanks for the clarification o7 I think a warning being shot out when using diraccess get_files and etc might be a good idea then if the prefix is res

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants