zipfile handling

Larry Bates larry.bates at websafe.com
Wed Nov 7 20:05:26 EST 2007


ad-hoc wrote:
> is there a rename utility for zipfile that can rename a directory
> inside a zipfile? also what's the best way to change the a file
> content inside a zip?
> 
> So if i have the following file in the zip file:
> 
> A/a1.txt
> A/a2.txt
> B/b1.txt
> 
> I want to rename A to be A1, and B to be B1, as well as changing the
> content of a1.txt and b1.txt.
> 
> I can certainly extract them to filesystem then rezip, but there might
> be a better way to do this?
> 
> thanks.
> 

Nope not a better way.  The zipping requires that you go through the process to 
get a proper zip file.

-Larry



More information about the Python-list mailing list