You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When searching large zip files (e.g. multi-GB logs or something), it's desirable not to decompress the whole thing in memory at one time. Instead, a psuedo-FILE object can be created with fopencookie(3) (glibc) or funopen(3) (BSD) that only needs to seek forwards and decompress small chunks at a time, and that FILE* can be passed to the ordinary streaming search routine.
Here's an example of what fopencookie/funopen-wrapped zip streaming looks like: https://github.com/cemeyer/Zlib-FILE (that implementation is permissively licensed, feel free to just drop it in to the_silver_searcher).
Aside from the FILE-wrapper code, the actual patch should be fairly small. Something like this:
Use the POSIX fopencookie(3) mechanism to produce a FILE object, and
then treat them the same as other non-mmapable streams (i.e., FIFOs).
Since some supported platforms do not support fopencookie(3) (Mac OS X,
maybe Cygwin, older BSDs), retain non-streaming zip file support.
Existing tests pass.
When searching large zip files (e.g. multi-GB logs or something), it's desirable not to decompress the whole thing in memory at one time. Instead, a psuedo-FILE object can be created with
fopencookie(3)
(glibc) orfunopen(3)
(BSD) that only needs to seek forwards and decompress small chunks at a time, and thatFILE*
can be passed to the ordinary streaming search routine.Here's an example of what
fopencookie
/funopen
-wrapped zip streaming looks like: https://github.com/cemeyer/Zlib-FILE (that implementation is permissively licensed, feel free to just drop it in to the_silver_searcher).Aside from the FILE-wrapper code, the actual patch should be fairly small. Something like this:
The text was updated successfully, but these errors were encountered: