@@ -3285,11 +3285,16 @@ def ReadInMultipleFilesWithContentToArray(infile, fmttype="auto", filestart=0, s
32853285def ReadInStackedFileWithContentToArray (infile , fmttype = "auto" , filestart = 0 , seekstart = 0 , seekend = 0 , listonly = False , contentasfile = True , uncompress = True , skipchecksum = False , formatspecs = __file_format_multi_dict__ , seektoend = False ):
32863286 outretval = []
32873287 outstartfile = filestart
3288+ outfsize = float ('inf' )
32883289 while True :
3289- outarray = ReadInFileWithContentToArray (infile , fmttype , outstartfile , seekstart , seekend , listonly , contentasfile , uncompress , skipchecksum , formatspecs , seektoend )
3290+ if outstartfile >= outfsize : # stop when function signals False
3291+ break
3292+ outarray = ArchiveFileToArray (infile , fmttype , outstartfile , seekstart , seekend , listonly , contentasfile , uncompress , skipchecksum , formatspecs , seektoend , True )
3293+ outfsize = outarray ['fsize' ]
32903294 if outarray is False : # stop when function signals False
32913295 break
32923296 infile = outarray ['fp' ]
3297+ outstartfile = infile .tell ()
32933298 outretval .append (outarray )
32943299 return outretval
32953300
@@ -7549,11 +7554,16 @@ def MultipleArchiveFilesToArray(infile, fmttype="auto", filestart=0, seekstart=0
75497554def StackedArchiveFileToArray (infile , fmttype = "auto" , filestart = 0 , seekstart = 0 , seekend = 0 , listonly = False , contentasfile = True , uncompress = True , skipchecksum = False , formatspecs = __file_format_multi_dict__ , seektoend = False , returnfp = False ):
75507555 outretval = []
75517556 outstartfile = filestart
7557+ outfsize = float ('inf' )
75527558 while True :
7559+ if outstartfile >= outfsize : # stop when function signals False
7560+ break
75537561 outarray = ArchiveFileToArray (infile , fmttype , outstartfile , seekstart , seekend , listonly , contentasfile , uncompress , skipchecksum , formatspecs , seektoend , True )
7562+ outfsize = outarray ['fsize' ]
75547563 if outarray is False : # stop when function signals False
75557564 break
75567565 infile = outarray ['fp' ]
7566+ outstartfile = infile .tell ()
75577567 outretval .append (outarray )
75587568 return outretval
75597569
0 commit comments