-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Directory: Alternative to list_dir_begin: get_files #1225
Comments
Yeah, I have some code written to work with As you can see there, |
We could also implement an iterator class for GDScript so there is no buffering issue |
"git gut" :P |
EDIT: |
Describe the project you are working on:
Working on some tests following my recent pull requests on
DirAccess
bug fixes.Describe the problem or limitation you are having in your project:
Listing files in a directory requires a lot of boilerplate code.
Example A:
Example B:
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
This proposal will allow an alternative option that is a lot simpler to write.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Note 1: If buffering all the files in a list is an issue, we should probably change

file_access_pack
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Technically yes, this can be worked around by writing one of the top examples. However, this is used quite often and will not break compatibility for 3.2.
Note 2: Depending on how people think of this,
list_dir_begin
,get_next
, andlist_dir_end
could be deprecated or removed in 4.0.Is there a reason why this should be core and not an add-on in the asset library?:
This is not really relevant since Directory is already part of core.
The text was updated successfully, but these errors were encountered: