Allow checking if a single specific file exists in an archive using ZIPReader #6834
Closed
Swarkin
started this conversation in
Engine Core
Replies: 1 comment 1 reply
-
Testing an implementation of this, will open a PR if it turns out nicely |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to be able to check if a specific file exists inside an archive, for example
if ZIPReader.file_exists(file_name):
without having to get all file names inside an archive (if file_name in ZIPReader.get_files():
)I'm assuming because it's possible to get all files, it should also be possible to just check for a single file in a similar way. (Correct me if I'm wrong, I don't code in C++, this may not even be possible?)
Why I requested this:
I'm working on an app which gets a list of zip files inside a directory, and displays metadata from a meta file inside of that archive.
Opening and using
if file_name in ZIPReader.get_files():
on each archive takes up to40ms
in my use case, totalling> 1200ms
.I have identified that the
get_files()
function takes by far the most time out of the entire process. Only checking for a single file instead of the entire archive would cut this down by a lot.Beta Was this translation helpful? Give feedback.
All reactions