@@ -3301,7 +3301,7 @@ def ReadInStackedFileWithContentToArray(infile, fmttype="auto", filestart=0, see
33013301 while True :
33023302 if outstartfile >= outfsize : # stop when function signals False
33033303 break
3304- outarray = ArchiveFileToArray (infile , fmttype , outstartfile , seekstart , seekend , listonly , contentasfile , uncompress , skipchecksum , formatspecs , seektoend , True )
3304+ outarray = FoxFileToArray (infile , fmttype , outstartfile , seekstart , seekend , listonly , contentasfile , uncompress , skipchecksum , formatspecs , seektoend , True )
33053305 outfsize = outarray ['fsize' ]
33063306 if outarray is False : # stop when function signals False
33073307 break
@@ -7068,24 +7068,69 @@ def FoxFileValidate(infile, fmttype="auto", filestart=0, formatspecs=__file_form
70687068 return False
70697069
70707070
7071- def FoxFileValidateFile (infile , fmttype = "auto" , formatspecs = __file_format_multi_dict__ , verbose = False , returnfp = False ):
7072- return FoxFileValidate (infile , fmttype , formatspecs , verbose , returnfp )
7071+ def FoxFileValidateFile (infile , fmttype = "auto" , filestart = 0 , formatspecs = __file_format_multi_dict__ , seektoend = False , verbose = False , returnfp = False ):
7072+ return FoxFileValidate (infile , fmttype , filestart , formatspecs , seektoend , verbose , returnfp )
70737073
70747074
7075- def FoxFileValidateMultiple (infile , fmttype = "auto" , formatspecs = __file_format_multi_dict__ , verbose = False , returnfp = False ):
7075+ def FoxFileValidateMultiple (infile , fmttype = "auto" , filestart = 0 , formatspecs = __file_format_multi_dict__ , seektoend = False , verbose = False , returnfp = False ):
70767076 if (isinstance (infile , (list , tuple , ))):
70777077 pass
70787078 else :
70797079 infile = [infile ]
70807080 outretval = True
70817081 for curfname in infile :
7082- curretfile = FoxFileValidate (curfname , fmttype , formatspecs , verbose , returnfp )
7082+ curretfile = FoxFileValidate (curfname , fmttype , filestart , formatspecs , seektoend , verbose , returnfp )
70837083 if (not curretfile ):
70847084 outretval = False
70857085 return outretval
70867086
7087- def FoxFileValidateMultipleFiles (infile , fmttype = "auto" , formatspecs = __file_format_multi_dict__ , verbose = False , returnfp = False ):
7088- return FoxFileValidateMultiple (infile , fmttype , formatspecs , verbose , returnfp )
7087+ def FoxFileValidateMultipleFiles (infile , fmttype = "auto" , filestart = 0 , formatspecs = __file_format_multi_dict__ , seektoend = False , verbose = False , returnfp = False ):
7088+ return FoxFileValidateMultiple (infile , fmttype , filestart , formatspecs , seektoend , verbose , returnfp )
7089+
7090+
7091+ def StackedFoxFileValidate (infile , fmttype = "auto" , filestart = 0 , formatspecs = __file_format_multi_dict__ , seektoend = False , verbose = False , returnfp = False ):
7092+ outretval = []
7093+ outstartfile = filestart
7094+ outfsize = float ('inf' )
7095+ while True :
7096+ if outstartfile >= outfsize : # stop when function signals False
7097+ break
7098+ is_valid_file = FoxFileValidate (infile , fmttype , filestart , formatspecs , seektoend , verbose , True )
7099+ if is_valid_file is False : # stop when function signals False
7100+ outretval .append (is_valid_file )
7101+ else :
7102+ outretval .append (True )
7103+ infile = is_valid_file
7104+ outstartfile = infile .tell ()
7105+ try :
7106+ infile .seek (0 , 2 )
7107+ except OSError :
7108+ SeekToEndOfFile (infile )
7109+ except ValueError :
7110+ SeekToEndOfFile (infile )
7111+ outfsize = infile .tell ()
7112+ infile .seek (outstartfile , 0 )
7113+ return outretval
7114+
7115+
7116+ def StackedFoxFileValidateFile (infile , fmttype = "auto" , filestart = 0 , formatspecs = __file_format_multi_dict__ , seektoend = False , verbose = False , returnfp = False ):
7117+ return StackedFoxFileValidate (infile , fmttype , filestart , formatspecs , seektoend , verbose , returnfp )
7118+
7119+
7120+ def StackedFoxFileValidateMultiple (infile , fmttype = "auto" , filestart = 0 , formatspecs = __file_format_multi_dict__ , seektoend = False , verbose = False , returnfp = False ):
7121+ if (isinstance (infile , (list , tuple , ))):
7122+ pass
7123+ else :
7124+ infile = [infile ]
7125+ outretval = True
7126+ for curfname in infile :
7127+ curretfile = StackedFoxFileValidate (curfname , fmttype , filestart , formatspecs , seektoend , verbose , returnfp )
7128+ if (not curretfile ):
7129+ outretval = False
7130+ return outretval
7131+
7132+ def StackedFoxFileValidateMultipleFiles (infile , fmttype = "auto" , filestart = 0 , formatspecs = __file_format_multi_dict__ , seektoend = False , verbose = False , returnfp = False ):
7133+ return StackedFoxFileValidateMultiple (infile , fmttype , filestart , formatspecs , seektoend , verbose , returnfp )
70897134
70907135def FoxFileToArray (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 ):
70917136 if (IsNestedDict (formatspecs ) and fmttype != "auto" and fmttype in formatspecs ):
@@ -7569,7 +7614,7 @@ def StackedFoxFileToArray(infile, fmttype="auto", filestart=0, seekstart=0, seek
75697614 while True :
75707615 if outstartfile >= outfsize : # stop when function signals False
75717616 break
7572- outarray = ArchiveFileToArray (infile , fmttype , outstartfile , seekstart , seekend , listonly , contentasfile , uncompress , skipchecksum , formatspecs , seektoend , True )
7617+ outarray = FoxFileToArray (infile , fmttype , outstartfile , seekstart , seekend , listonly , contentasfile , uncompress , skipchecksum , formatspecs , seektoend , True )
75737618 outfsize = outarray ['fsize' ]
75747619 if outarray is False : # stop when function signals False
75757620 break
0 commit comments