@@ -713,6 +713,7 @@ def ReadFileHeaderDataBySizeWithContentToArray(fp, listonly=False, skipchecksum=
713713 return False ;
714714 fp .seek (1 , 1 );
715715 fcontentend = fp .tell () - 1 ;
716+ fcontents .seek (0 , 0 );
716717 catlist = {'fheadersize' : fheadsize , 'fhstart' : fheaderstart , 'fhend' : fhend , 'ftype' : ftype , 'fname' : fname , 'fbasedir' : fbasedir , 'flinkname' : flinkname , 'fsize' : fsize , 'fatime' : fatime , 'fmtime' : fmtime , 'fctime' : fctime , 'fbtime' : fbtime , 'fmode' : fmode , 'fchmode' : fchmode , 'ftypemod' : ftypemod , 'fwinattributes' : fwinattributes , 'fuid' : fuid , 'funame' : funame , 'fgid' : fgid , 'fgname' : fgname , 'finode' : finode , 'flinkcount' : flinkcount , 'fminor' : fdev_minor , 'fmajor' : fdev_major , 'frminor' : frdev_minor , 'frmajor' : frdev_major , 'fchecksumtype' : fchecksumtype , 'fnumfields' : fnumfields + 2 , 'frawheader' : HeaderOut , 'fextrafields' : fextrafields , 'fextrafieldsize' : fextrasize , 'fextralist' : extrafieldslist , 'fheaderchecksum' : fcs , 'fcontentchecksum' : fccs , 'fhascontents' : pyhascontents , 'fcontentstart' : fcontentstart , 'fcontentend' : fcontentend , 'fcontents' : fcontents };
717718 return catlist ;
718719
@@ -4457,6 +4458,7 @@ def ArchiveFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipcheck
44574458 pyhascontents = False ;
44584459 catfp .seek (1 , 1 );
44594460 catfcontentend = catfp .tell () - 1 ;
4461+ catfcontents .seek (0 , 0 );
44604462 catlist ['ffilelist' ].update ({realidnum : {'fid' : realidnum , 'fidalt' : fileidnum , 'fheadersize' : catfheadsize , 'fhstart' : catfhstart , 'fhend' : catfhend , 'ftype' : catftype , 'fname' : catfname , 'fbasedir' : catfbasedir , 'flinkname' : catflinkname , 'fsize' : catfsize , 'fatime' : catfatime , 'fmtime' : catfmtime , 'fctime' : catfctime , 'fbtime' : catfbtime , 'fmode' : catfmode , 'fchmode' : catfchmode , 'ftypemod' : catftypemod , 'fwinattributes' : catfwinattributes , 'fuid' : catfuid , 'funame' : catfuname , 'fgid' : catfgid , 'fgname' : catfgname , 'finode' : finode , 'flinkcount' : flinkcount , 'fminor' : catfdev_minor , 'fmajor' : catfdev_major , 'frminor' : catfrdev_minor , 'frmajor' : catfrdev_major , 'fchecksumtype' : catfchecksumtype , 'fnumfields' : catfnumfields + 2 , 'frawheader' : catheaderdata , 'fextrafields' : catfextrafields , 'fextrafieldsize' : catfextrasize , 'fextralist' : extrafieldslist , 'fheaderchecksum' : catfcs , 'fcontentchecksum' : catfccs , 'fhascontents' : pyhascontents , 'fcontentstart' : catfcontentstart , 'fcontentend' : catfcontentend , 'fcontents' : catfcontents } });
44614463 fileidnum = fileidnum + 1 ;
44624464 realidnum = realidnum + 1 ;
@@ -4741,6 +4743,7 @@ def ListDirToArrayAlt(infiles, dirlistfromtxt=False, followlink=False, listonly=
47414743 if (int (fsize )> 0 and listonly ):
47424744 fcontents = BytesIO ();
47434745 pyhascontents = False ;
4746+ fcontents .seek (0 , 0 );
47444747 catlist ['ffilelist' ].update ({fileidnum : {'fid' : fileidnum , 'fidalt' : fileidnum , 'fheadersize' : int (catheaersize , 16 ), 'fhstart' : catfhstart , 'fhend' : catfhend , 'ftype' : ftype , 'fname' : fname , 'fbasedir' : fbasedir , 'flinkname' : flinkname , 'fsize' : fsize , 'fatime' : fatime , 'fmtime' : fmtime , 'fctime' : fctime , 'fbtime' : fbtime , 'fmode' : fmode , 'fchmode' : fchmode , 'ftypemod' : ftypemod , 'fwinattributes' : fwinattributes , 'fuid' : fuid , 'funame' : funame , 'fgid' : fgid , 'fgname' : fgname , 'finode' : finode , 'flinkcount' : flinkcount , 'fminor' : fdev_minor , 'fmajor' : fdev_major , 'frminor' : frdev_minor , 'frmajor' : frdev_major , 'fchecksumtype' : checksumtype , 'fnumfields' : catfnumfields + 2 , 'frawheader' : catheaderdata , 'fextrafields' : catfextrafields , 'fextrafieldsize' : extrasizelen , 'fextralist' : extrafieldslist , 'fheaderchecksum' : int (catfileheadercshex , 16 ), 'fcontentchecksum' : int (catfilecontentcshex , 16 ), 'fhascontents' : pyhascontents , 'fcontentstart' : catfcontentstart , 'fcontentend' : catfcontentend , 'fcontents' : fcontents } });
47454748 fileidnum = fileidnum + 1 ;
47464749 return catlist ;
@@ -4913,6 +4916,7 @@ def TarFileToArrayAlt(infiles, listonly=False, checksumtype="crc32", extradata=[
49134916 if (int (fsize )> 0 and listonly ):
49144917 fcontents = "" ;
49154918 pyhascontents = False ;
4919+ fcontents .seek (0 , 0 );
49164920 catlist ['ffilelist' ].update ({fileidnum : {'fid' : fileidnum , 'fidalt' : fileidnum , 'fheadersize' : int (catheaersize , 16 ), 'fhstart' : catfhstart , 'fhend' : catfhend , 'ftype' : ftype , 'fname' : fname , 'fbasedir' : fbasedir , 'flinkname' : flinkname , 'fsize' : fsize , 'fatime' : fatime , 'fmtime' : fmtime , 'fctime' : fctime , 'fbtime' : fbtime , 'fmode' : fmode , 'fchmode' : fchmode , 'ftypemod' : ftypemod , 'fwinattributes' : fwinattributes , 'fuid' : fuid , 'funame' : funame , 'fgid' : fgid , 'fgname' : fgname , 'finode' : finode , 'flinkcount' : flinkcount , 'fminor' : fdev_minor , 'fmajor' : fdev_major , 'frminor' : frdev_minor , 'frmajor' : frdev_major , 'fchecksumtype' : checksumtype , 'fnumfields' : catfnumfields + 2 , 'frawheader' : catheaderdata , 'fextrafields' : catfextrafields , 'fextrafieldsize' : extrasizelen , 'fextralist' : extrafieldslist , 'fheaderchecksum' : int (catfileheadercshex , 16 ), 'fcontentchecksum' : int (catfilecontentcshex , 16 ), 'fhascontents' : pyhascontents , 'fcontentstart' : catfcontentstart , 'fcontentend' : catfcontentend , 'fcontents' : fcontents } });
49174921 fileidnum = fileidnum + 1 ;
49184922 return catlist ;
@@ -5103,6 +5107,7 @@ def ZipFileToArrayAlt(infiles, listonly=False, checksumtype="crc32", extradata=[
51035107 if (int (fsize )> 0 and listonly ):
51045108 fcontents = BytesIO ();
51055109 pyhascontents = False ;
5110+ fcontents .seek (0 , 0 );
51065111 catlist ['ffilelist' ].update ({fileidnum : {'fid' : fileidnum , 'fidalt' : fileidnum , 'fheadersize' : int (catheaersize , 16 ), 'fhstart' : catfhstart , 'fhend' : catfhend , 'ftype' : ftype , 'fname' : fname , 'fbasedir' : fbasedir , 'flinkname' : flinkname , 'fsize' : fsize , 'fatime' : fatime , 'fmtime' : fmtime , 'fctime' : fctime , 'fbtime' : fbtime , 'fmode' : fmode , 'fchmode' : fchmode , 'ftypemod' : ftypemod , 'fwinattributes' : fwinattributes , 'fuid' : fuid , 'funame' : funame , 'fgid' : fgid , 'fgname' : fgname , 'finode' : finode , 'flinkcount' : flinkcount , 'fminor' : fdev_minor , 'fmajor' : fdev_major , 'frminor' : frdev_minor , 'frmajor' : frdev_major , 'fchecksumtype' : checksumtype , 'fnumfields' : catfnumfields + 2 , 'frawheader' : catheaderdata , 'fextrafields' : catfextrafields , 'fextrafieldsize' : extrasizelen , 'fextralist' : extrafieldslist , 'fheaderchecksum' : int (catfileheadercshex , 16 ), 'fcontentchecksum' : int (catfilecontentcshex , 16 ), 'fhascontents' : pyhascontents , 'fcontentstart' : catfcontentstart , 'fcontentend' : catfcontentend , 'fcontents' : fcontents } });
51075112 fileidnum = fileidnum + 1 ;
51085113 return catlist ;
@@ -5311,6 +5316,7 @@ def RarFileToArrayAlt(infiles, listonly=False, checksumtype="crc32", extradata=[
53115316 if (int (fsize )> 0 and listonly ):
53125317 fcontents = BytesIO ();
53135318 pyhascontents = False ;
5319+ fcontents .seek (0 , 0 );
53145320 catlist ['ffilelist' ].update ({fileidnum : {'fid' : fileidnum , 'fidalt' : fileidnum , 'fheadersize' : int (catheaersize , 16 ), 'fhstart' : catfhstart , 'fhend' : catfhend , 'ftype' : ftype , 'fname' : fname , 'fbasedir' : fbasedir , 'flinkname' : flinkname , 'fsize' : fsize , 'fatime' : fatime , 'fmtime' : fmtime , 'fctime' : fctime , 'fbtime' : fbtime , 'fmode' : fmode , 'fchmode' : fchmode , 'ftypemod' : ftypemod , 'fwinattributes' : fwinattributes , 'fuid' : fuid , 'funame' : funame , 'fgid' : fgid , 'fgname' : fgname , 'finode' : finode , 'flinkcount' : flinkcount , 'fminor' : fdev_minor , 'fmajor' : fdev_major , 'frminor' : frdev_minor , 'frmajor' : frdev_major , 'fchecksumtype' : checksumtype , 'fnumfields' : catfnumfields + 2 , 'frawheader' : catheaderdata , 'fextrafields' : catfextrafields , 'fextrafieldsize' : extrasizelen , 'fextralist' : extrafieldslist , 'fheaderchecksum' : int (catfileheadercshex , 16 ), 'fcontentchecksum' : int (catfilecontentcshex , 16 ), 'fhascontents' : pyhascontents , 'fcontentstart' : catfcontentstart , 'fcontentend' : catfcontentend , 'fcontents' : fcontents } });
53155321 fileidnum = fileidnum + 1 ;
53165322 return catlist ;
@@ -5464,6 +5470,7 @@ def SevenZipFileToArrayAlt(infiles, listonly=False, checksumtype="crc32", extrad
54645470 if (int (fsize )> 0 and listonly ):
54655471 fcontents = "" ;
54665472 pyhascontents = False ;
5473+ fcontents .seek (0 , 0 );
54675474 catlist ['ffilelist' ].update ({fileidnum : {'fid' : fileidnum , 'fidalt' : fileidnum , 'fheadersize' : int (catheaersize , 16 ), 'fhstart' : catfhstart , 'fhend' : catfhend , 'ftype' : ftype , 'fname' : fname , 'fbasedir' : fbasedir , 'flinkname' : flinkname , 'fsize' : fsize , 'fatime' : fatime , 'fmtime' : fmtime , 'fctime' : fctime , 'fbtime' : fbtime , 'fmode' : fmode , 'fchmode' : fchmode , 'ftypemod' : ftypemod , 'fwinattributes' : fwinattributes , 'fuid' : fuid , 'funame' : funame , 'fgid' : fgid , 'fgname' : fgname , 'finode' : finode , 'flinkcount' : flinkcount , 'fminor' : fdev_minor , 'fmajor' : fdev_major , 'frminor' : frdev_minor , 'frmajor' : frdev_major , 'fchecksumtype' : checksumtype , 'fnumfields' : catfnumfields + 2 , 'frawheader' : catheaderdata , 'fextrafields' : catfextrafields , 'fextrafieldsize' : extrasizelen , 'fextralist' : extrafieldslist , 'fheaderchecksum' : int (catfileheadercshex , 16 ), 'fcontentchecksum' : int (catfilecontentcshex , 16 ), 'fhascontents' : pyhascontents , 'fcontentstart' : catfcontentstart , 'fcontentend' : catfcontentend , 'fcontents' : fcontents } });
54685475 fileidnum = fileidnum + 1 ;
54695476 return catlist ;
0 commit comments