New submission from Ross <rossmclen...@tamu.edu>: 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. ---------- components: Library (Lib) messages: 92154 nosy: rossmclendon severity: normal status: open title: remove/delete method for zipfile/tarfile objects type: feature request versions: Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6818> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com