Message120858
| Author | lars.gustaebel |
|---|---|
| Recipients | lars.gustaebel, strombrg |
| Date | 2010-11-09.10:42:39 |
| SpamBayes Score | 0.00059214554 |
| 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:41 | lars.gustaebel | set | recipients: + lars.gustaebel, strombrg |
| 2010-11-09 10:42:41 | lars.gustaebel | set | messageid: <1289299361.4.0.0116687672033.issue10369@psf.upfronthosting.co.za> |
| 2010-11-09 10:42:40 | lars.gustaebel | link | issue10369 messages |
| 2010-11-09 10:42:39 | lars.gustaebel | create | |