in reply to Re: Fetch URL Contents to File Handle
in thread Fetch URL Contents to File Handle

A ZIP file's central directory is at the end of the file. Although you could get fancy with range requests, ...

This is true, but it is also possible to read a zip file in streaming mode without using the central directory at the end of the file. That's what IO::Uncompress::AnyUncompress does (via IO::Uncompress::Unzip).

If there is a HTTP module that exposes a filehandle interface, then IO::Uncompress::AnyUncompress can read it.

  • Comment on Re^2: Fetch URL Contents to File Handle

Replies are listed 'Best First'.
Re^3: Fetch URL Contents to File Handle
by haukex (Archbishop) on Jun 10, 2020 at 20:12 UTC
    This is true, but it is also possible to read a zip file in streaming mode without using the central directory at the end of the file.

    Yes, that's a good point, thanks! My understanding is that it's possible for files to have been deleted or replaced in the central directory but still be present in the ZIP file, but I haven't encountered such a ZIP file in the wild myself. I did write the parent node before I had looked into the ZIP file in question to discover that it only contains a single file.