Skip to content

Commit c1ad274

Browse files
committed
Small update
1 parent 22b7f1e commit c1ad274

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pycatfile/pycatfile.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6193,6 +6193,8 @@ def AppendFilesWithContentToList(infiles, dirlistfromtxt=False, extradata=[], js
61936193
if not followlink and ftype in data_types:
61946194
with open(fname, "rb") as fpc:
61956195
shutil.copyfileobj(fpc, fcontents, length=__filebuff_size__)
6196+
if(fsize is not fcontents.tell()):
6197+
fsize = format(int(fcontents.tell()), 'x').lower()
61966198
typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
61976199
fcontents.seek(0, 0)
61986200
if(typechecktest is not False):
@@ -6472,6 +6474,8 @@ def AppendFilesWithContentFromTarFileToList(infile, extradata=[], jsondata={}, c
64726474
if ftype in data_types:
64736475
fpc = tarfp.extractfile(member)
64746476
shutil.copyfileobj(fpc, fcontents, length=__filebuff_size__)
6477+
if(fsize is not fcontents.tell()):
6478+
fsize = format(int(fcontents.tell()), 'x').lower()
64756479
fpc.close()
64766480
typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
64776481
fcontents.seek(0, 0)
@@ -6741,6 +6745,8 @@ def AppendFilesWithContentFromBSDTarFileToList(infile, extradata=[], jsondata={}
67416745
sparse_types = {12}
67426746
if ftype in zero_length_types:
67436747
fsize = format(int("0"), 'x').lower()
6748+
elif member.size is None:
6749+
fsize = format(int("0"), 'x').lower()
67446750
elif ftype in data_types:
67456751
fsize = format(int(member.size), 'x').lower()
67466752
else:
@@ -6784,6 +6790,8 @@ def AppendFilesWithContentFromBSDTarFileToList(infile, extradata=[], jsondata={}
67846790
fcontents.write(member.read())
67856791
else:
67866792
pass
6793+
if(fsize is not fcontents.tell()):
6794+
fsize = format(int(fcontents.tell()), 'x').lower()
67876795
typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
67886796
fcontents.seek(0, 0)
67896797
if(typechecktest is not False):
@@ -7030,6 +7038,8 @@ def AppendFilesWithContentFromZipFileToList(infile, extradata=[], jsondata={}, c
70307038
curcompression = "none"
70317039
if ftype == 0:
70327040
fcontents.write(zipfp.read(member.filename))
7041+
if(fsize is not fcontents.tell()):
7042+
fsize = format(int(fcontents.tell()), 'x').lower()
70337043
typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
70347044
fcontents.seek(0, 0)
70357045
if(typechecktest is not False):
@@ -7266,6 +7276,8 @@ def AppendFilesWithContentFromRarFileToList(infile, extradata=[], jsondata={}, c
72667276
curcompression = "none"
72677277
if ftype == 0:
72687278
fcontents.write(rarfp.read(member.filename))
7279+
if(fsize is not fcontents.tell()):
7280+
fsize = format(int(fcontents.tell()), 'x').lower()
72697281
typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
72707282
fcontents.seek(0, 0)
72717283
if(typechecktest is not False):

0 commit comments

Comments
 (0)