* Adam A. Zajac <[EMAIL PROTECTED]> [2007-06-27 11:26]:
> I was reading over the documentation for the tarfile module and it
> occurred to me that there didn't seem to be a way to remove an
> individual file from the tar.
> 
> For example, suppose I did this:
> 
> import tarfile
> tar = tarfile.open("sample.tar", "w")
> tar.add("unwanted")
> tar.add("wanted")
> tar.close()
> 
> At this point, how could I come back and remove "unwanted" from the tar?

Wel, it looks like tar's --remove-files is not supported yet, you would
probably have to reopen the tarfile, write it to a new one file-by-file,
excluding the ones you don't want.  Messy :-(

-- 
David Rock
[EMAIL PROTECTED]
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to