vfs: support recursive readdir in ZipProvider - #66127
Open
pipobscure wants to merge 1 commit into
Open
pipobscure wants to merge 1 commit into
pipobscure wants to merge 1 commit into
Conversation
ZipProvider threw ERR_METHOD_NOT_IMPLEMENTED for readdir() with
`{ recursive: true }`, although an archive already stores every member
under its full path, so a recursive listing is the same scan of the
entry names as a flat one, keeping the whole path below the directory
instead of only its first segment.
List every member below the directory, and every directory their paths
pass through, whether the archive holds an entry for it or only implies
it. Names are relative to the listed directory and joined with `/`, as
MemoryProvider returns them, so VirtualFileSystem reports the right
parentPath for each Dirent. A name that is both a member and a
directory is listed once, as a directory, as a flat listing already
did.
The entries are now collected in a map rather than looked up in an
array, so listing a directory no longer takes time quadratic in the
number of its children.
Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66127 +/- ##
==========================================
+ Coverage 90.27% 90.28% +0.01%
==========================================
Files 790 790
Lines 271651 271784 +133
Branches 51842 51876 +34
==========================================
+ Hits 245228 245380 +152
+ Misses 16928 16896 -32
- Partials 9495 9508 +13
🚀 New features to boost your workflow:
|
jasnell
approved these changes
Sep 19, 2026
Contributor
Author
|
Can someone please restart the lint and add |
Collaborator
Contributor
Author
|
I have no idea what the failing CI test is. I did run all tests on Windows & Linux, so I’m assuming it’s a flake until hearing otherwise. If someone can tell me, I’d appreciate it. |
Contributor
Author
|
@richardlau can you have a look at CI for me please. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ZipProvider threw ERR_METHOD_NOT_IMPLEMENTED for readdir() with
{ recursive: true }, although an archive already stores every member under its full path, so a recursive listing is the same scan of the entry names as a flat one, keeping the whole path below the directory instead of only its first segment.List every member below the directory, and every directory their paths pass through, whether the archive holds an entry for it or only implies it. Names are relative to the listed directory and joined with
/, as MemoryProvider returns them, so VirtualFileSystem reports the right parentPath for each Dirent. A name that is both a member and a directory is listed once, as a directory, as a flat listing already did.The entries are now collected in a map rather than looked up in an array, so listing a directory no longer takes time quadratic in the number of its children.