Author lars.gustaebel
Recipients lars.gustaebel, strombrg
Date 2010-11-09.10:42:39
SpamBayes Score 0.000592146
Marked as misclassified No
Message-id <1289299361.4.0.0116687672033.issue10369@psf.upfronthosting.co.za>
In-reply-to
Content
Hm, why don't you just do this:

with stat_tarfile.open(fileobj = sys.stdout, mode = "w|") as tar:
    for number in xrange(100):
        fileobj = generate_file_content(number)
        tarinfo = tar.gettarinfo(fileobj=open("/etc/passwd")) 
        tarinfo.name = 'file-%d.txt' % number
        tarinfo.size = len(str(number)) * 100
        tarinfo.uid = 1000
        tarinfo.gid = 1000
        tarinfo.uname = "dstromberg"
        tarinfo.gname = "dstromberg"
        tar.addfile(tarinfo, fileobj)

Wouldn't that work, too? Or am I missing something?
History
Date User Action Args
2010-11-09 10:42:41lars.gustaebelsetrecipients: + lars.gustaebel, strombrg
2010-11-09 10:42:41lars.gustaebelsetmessageid: <1289299361.4.0.0116687672033.issue10369@psf.upfronthosting.co.za>
2010-11-09 10:42:40lars.gustaebellinkissue10369 messages
2010-11-09 10:42:39lars.gustaebelcreate