newbie question: nested archives and zipfile

G

gilbeert

I sorry, but I'm not very familiar with Python.
Please, help to solve my problem with reading file from "nested" zip
archive.
There is an ear_file.ear and inside this file there is a war_file.war
and inside this file there is a jar_file.jar.
I have to read content of a file (my_file.txt) from inside a
jar_file.jar:
ear_file.ear > war_file.war > jar_file.jar > my_file.txt

Is it possible to directly read my_file.txt from inside this kind of
nested archive?
Please, give an example how to do that.

Do I have to open ear_file.ear, read war_file.war, write it to file
and then open writed war_file.war, read jar_file.jar, write it to
file
and then open wreted jar_file.jar and read my_file.txt??

Thanks in advance!
 
D

Diez B. Roggisch

I sorry, but I'm not very familiar with Python.
Please, help to solve my problem with reading file from "nested" zip
archive.
There is an ear_file.ear and inside this file there is a war_file.war
and inside this file there is a jar_file.jar.
I have to read content of a file (my_file.txt) from inside a
jar_file.jar:
ear_file.ear > war_file.war > jar_file.jar > my_file.txt

Is it possible to directly read my_file.txt from inside this kind of
nested archive?
Please, give an example how to do that.

No.
Do I have to open ear_file.ear, read war_file.war, write it to file
and then open writed war_file.war, read jar_file.jar, write it to
file
and then open wreted jar_file.jar and read my_file.txt??

Yes. Depending on the size of the files, it might be possible to use
StringIO to keep the files in-memory without using temp-files.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top