Transparently treating tar files and zip archives as directories

Paul Moore p.f.moore at gmail.com
Sun Jan 6 17:38:27 EST 2019


Pyfilesystem (https://pypi.org/project/fs/) does something like this -
it might be what you're after,

Paul

On Sun, 6 Jan 2019 at 22:32, Skip Montanaro <skip.montanaro at gmail.com> wrote:
>
> I find it useful in some of the work I do to treat Zip archives as if
> they were directories. I don't think it would be too difficult to make
> it pretty much transparent, so that you could execute something like:
>
> fileobj = magic_open("/path/to/some/archive.zip/some/internal/path/magic.txt")
>
> or equivalent for writing and other list-y, glob-y sorts of things.
> (In fact, I'd be mildly surprised if I couldn't find something on PyPI
> if I spent a few minutes searching.)
>
> As I considered that idea the other day, I thought, "Hmmm... might be
> useful for tar files as well." Alas, the tarfile module API didn't
> seem like it would support such a higher level API anywhere near as
> easily. Is that a fundamental property/shortcoming of the tarfile
> format, or is it just a function of the tarfile module's API?
>
> Skip
> --
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list