Filename patch from Robert J. Clark

svn: r992
This commit is contained in:
Don Allingham 2002-05-15 12:57:19 +00:00
parent 6054e45819
commit 3c44674456

View File

@ -20,6 +20,7 @@
import gzip import gzip
import cStringIO import cStringIO
import string import string
import os
_BLKSIZE=512 _BLKSIZE=512
nul = '\0' nul = '\0'
@ -130,14 +131,19 @@ class ReadTarFile:
filename = buf[0:index] filename = buf[0:index]
self.f.read(24) # modes self.f.read(24) # modes
l = self.f.read(12) l = self.f.read(12)
length = int(l,8) # length = int(l,8)
length_string = "";
for char in l:
if ord(char) != 0:
length_string = length_string + char
length = string.atoi(length_string,8)
self.f.read(12) self.f.read(12)
self.f.read(6) self.f.read(6)
self.f.read(111) self.f.read(111)
self.f.read(64) self.f.read(64)
self.f.read(183) self.f.read(183)
foo = open(filename,"wb") foo = open(self.wd + os.sep + filename,"wb")
foo.write(self.f.read(length)) foo.write(self.f.read(length))
foo.close() foo.close()
self.f.read(_BLKSIZE-(length%_BLKSIZE)) self.f.read(_BLKSIZE-(length%_BLKSIZE))