WIP zipfs index on open
What would it look like to have a VFS based on zip files?
This is currently not easily demo-able because it lacks glue code that tells pages to use zipfs, but see !327 (comment 397075619) for how it can be hacked together.
How is this MR different from !326 (closed)? (I did not know about !326 (closed) when I wrote this MR.)
- This MR uses
httprs
and takes precautions to make it thread-safe; !326 (closed) replaceshttprs
with thread safe code - This MR is more paranoid about zip file structure than !326 (closed) (don't assume clean paths, don't assume directories have explicit entries)
- !326 (closed) together with !325 (merged) has more detail on how to connect the zip fs to the rest of pages. I don't know the code that well. This MR would be bigger if more of the glue code was in here.
Because of the zip file paranoia I ended up with a sorted slice and binary search, instead of using a map for attribute lookups like !326 (closed). The sorted slice lets me say "there is no file foo/bar
but I see a file foo/bar/x
so foo/bar
is a directory", without assuming that "whoever made the zip file was nice enough to create a foo/bar
directory entry for my attribute lookups".
I don't think it matters too much because these are in memory data structures. If we choose an implementation that is not paranoid enough we can make it more paranoid later without having to rewrite zip files.