Message92154
It would be most helpful if a method could be included in the TarFile
class of the tarfile module and the ZipFile class of the zipfile module
that would remove a particular file (either given by a name or a
TarInfo/ZipInfo object) from the archive.
Usage to remove a single file from an archive would be as follows:
import zipfile
zipFileObject = zipfile.ZipFile(archiveName,'a')
zipFileObject.remove(fileToRemove)
zipFileObject.close()
Such a method should probably only apply to archives that are in append
mode as write mode would erase the original archive and read mode should
render the archive immutable.
One possible extra to be included is to allow a list of file names or
ZipInfo/TarInfo objects to be passed into the remove method, such that
all items in the list would be removed from the archive. |
|
Date |
User |
Action |
Args |
2009-09-02 04:42:14 | rossmclendon | set | recipients:
+ rossmclendon |
2009-09-02 04:42:12 | rossmclendon | set | messageid: <1251866532.69.0.504306670253.issue6818@psf.upfronthosting.co.za> |
2009-09-02 04:42:09 | rossmclendon | link | issue6818 messages |
2009-09-02 04:42:07 | rossmclendon | create | |
|