PyCatFile 0.13.10__tar.gz → 0.13.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pycatfile-0.13.10 → pycatfile-0.13.12}/PKG-INFO +1 -1
- {pycatfile-0.13.10 → pycatfile-0.13.12}/PyCatFile.egg-info/PKG-INFO +1 -1
- {pycatfile-0.13.10 → pycatfile-0.13.12}/catfile.py +1 -1
- {pycatfile-0.13.10 → pycatfile-0.13.12}/neocatfile.py +1 -1
- {pycatfile-0.13.10 → pycatfile-0.13.12}/pycatfile.py +109 -85
- {pycatfile-0.13.10 → pycatfile-0.13.12}/setup.py +1 -1
- {pycatfile-0.13.10 → pycatfile-0.13.12}/LICENSE +0 -0
- {pycatfile-0.13.10 → pycatfile-0.13.12}/PyCatFile.egg-info/SOURCES.txt +0 -0
- {pycatfile-0.13.10 → pycatfile-0.13.12}/PyCatFile.egg-info/dependency_links.txt +0 -0
- {pycatfile-0.13.10 → pycatfile-0.13.12}/PyCatFile.egg-info/top_level.txt +0 -0
- {pycatfile-0.13.10 → pycatfile-0.13.12}/PyCatFile.egg-info/zip-safe +0 -0
- {pycatfile-0.13.10 → pycatfile-0.13.12}/README.md +0 -0
- {pycatfile-0.13.10 → pycatfile-0.13.12}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyCatFile
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.12
|
|
4
4
|
Summary: A tar like file format name catfile after unix cat command (concatenate files) .
|
|
5
5
|
Home-page: https://github.com/GameMaker2k/PyCatFile
|
|
6
6
|
Download-URL: https://github.com/GameMaker2k/PyCatFile/archive/master.tar.gz
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyCatFile
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.12
|
|
4
4
|
Summary: A tar like file format name catfile after unix cat command (concatenate files) .
|
|
5
5
|
Home-page: https://github.com/GameMaker2k/PyCatFile
|
|
6
6
|
Download-URL: https://github.com/GameMaker2k/PyCatFile/archive/master.tar.gz
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Copyright 2018-2024 Game Maker 2k - http://intdb.sourceforge.net/
|
|
15
15
|
Copyright 2018-2024 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
16
16
|
|
|
17
|
-
$FileInfo: catfile.py - Last Update: 6/
|
|
17
|
+
$FileInfo: catfile.py - Last Update: 6/26/2024 Ver. 0.13.12 RC 1 - Author: cooldude2k $
|
|
18
18
|
'''
|
|
19
19
|
|
|
20
20
|
from __future__ import absolute_import, division, print_function, unicode_literals;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Copyright 2018-2024 Game Maker 2k - http://intdb.sourceforge.net/
|
|
15
15
|
Copyright 2018-2024 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
16
16
|
|
|
17
|
-
$FileInfo: neocatfile.py - Last Update: 6/
|
|
17
|
+
$FileInfo: neocatfile.py - Last Update: 6/26/2024 Ver. 0.13.12 RC 1 - Author: cooldude2k $
|
|
18
18
|
'''
|
|
19
19
|
|
|
20
20
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Copyright 2018-2024 Game Maker 2k - http://intdb.sourceforge.net/
|
|
15
15
|
Copyright 2018-2024 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
16
16
|
|
|
17
|
-
$FileInfo: pycatfile.py - Last Update: 6/
|
|
17
|
+
$FileInfo: pycatfile.py - Last Update: 6/26/2024 Ver. 0.13.12 RC 1 - Author: cooldude2k $
|
|
18
18
|
'''
|
|
19
19
|
|
|
20
20
|
from __future__ import absolute_import, division, print_function, unicode_literals;
|
|
@@ -214,11 +214,11 @@ __file_format_list__ = [__file_format_name__, __file_format_magic__, __file_form
|
|
|
214
214
|
__file_format_dict__ = {'format_name': __file_format_name__, 'format_magic': __file_format_magic__, 'format_lower': __file_format_lower__, 'format_len': __file_format_len__, 'format_hex': __file_format_hex__, 'format_delimiter': __file_format_delimiter__, 'format_ver': __file_format_ver__, 'new_style': __use_new_style__, 'use_advanced_list': __use_advanced_list__, 'use_alt_inode': __use_alt_inode__};
|
|
215
215
|
__project__ = __program_name__;
|
|
216
216
|
__project_url__ = "https://github.com/GameMaker2k/PyCatFile";
|
|
217
|
-
__version_info__ = (0, 13,
|
|
218
|
-
__version_date_info__ = (2024, 6,
|
|
217
|
+
__version_info__ = (0, 13, 12, "RC 1", 1);
|
|
218
|
+
__version_date_info__ = (2024, 6, 26, "RC 1", 1);
|
|
219
219
|
__version_date__ = str(__version_date_info__[0]) + "." + str(__version_date_info__[1]).zfill(2) + "." + str(__version_date_info__[2]).zfill(2);
|
|
220
220
|
__revision__ = __version_info__[3];
|
|
221
|
-
__revision_id__ = "$Id:
|
|
221
|
+
__revision_id__ = "$Id: 08421f3d82901583005f4ce8695097e5ed1c2e11 $";
|
|
222
222
|
if(__version_info__[4] is not None):
|
|
223
223
|
__version_date_plusrc__ = __version_date__ + "-" + str(__version_date_info__[4]);
|
|
224
224
|
if(__version_info__[4] is None):
|
|
@@ -1483,7 +1483,7 @@ def ReadFileHeaderDataBySizeWithContent(fp, listonly=False, uncompress=True, ski
|
|
|
1483
1483
|
HeaderOut.append(fcontents);
|
|
1484
1484
|
return HeaderOut;
|
|
1485
1485
|
|
|
1486
|
-
def ReadFileHeaderDataBySizeWithContentToArray(fp, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
1486
|
+
def ReadFileHeaderDataBySizeWithContentToArray(fp, listonly=False, contentasfile=True, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
1487
1487
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
1488
1488
|
delimiter = formatspecs['format_delimiter'];
|
|
1489
1489
|
fheaderstart = fp.tell();
|
|
@@ -1590,7 +1590,9 @@ def ReadFileHeaderDataBySizeWithContentToArray(fp, listonly=False, uncompress=Tr
|
|
|
1590
1590
|
else:
|
|
1591
1591
|
return False;
|
|
1592
1592
|
fcontents.seek(0, 0);
|
|
1593
|
-
|
|
1593
|
+
if(not contentasfile):
|
|
1594
|
+
fcontents = fcontents.read();
|
|
1595
|
+
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, 'fcompression': fcompression, 'fcsize': fcsize, 'fuid': fuid, 'funame': funame, 'fgid': fgid, 'fgname': fgname, 'finode': finode, 'flinkcount': flinkcount, 'fminor': fdev_minor, 'fmajor': fdev_major, 'frminor': frdev_minor, 'frmajor': frdev_major, 'fseeknextfile': fseeknextfile, 'fheaderchecksumtype': HeaderOut[-4], 'fcontentchecksumtype': HeaderOut[-3], 'fnumfields': fnumfields + 2, 'frawheader': HeaderOut, 'fextrafields': fextrafields, 'fextrafieldsize': fextrasize, 'fextralist': extrafieldslist, 'fheaderchecksum': fcs, 'fcontentchecksum': fccs, 'fhascontents': pyhascontents, 'fcontentstart': fcontentstart, 'fcontentend': fcontentend, 'fcontentasfile': contentasfile, 'fcontents': fcontents};
|
|
1594
1596
|
return catlist;
|
|
1595
1597
|
|
|
1596
1598
|
def ReadFileHeaderDataBySizeWithContentToList(fp, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
@@ -1729,7 +1731,7 @@ def ReadFileDataBySizeWithContent(fp, listonly=False, uncompress=True, skipcheck
|
|
|
1729
1731
|
countnum = countnum + 1;
|
|
1730
1732
|
return flist;
|
|
1731
1733
|
|
|
1732
|
-
def ReadFileDataBySizeWithContentToArray(fp, seekstart=0, seekend=0, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
1734
|
+
def ReadFileDataBySizeWithContentToArray(fp, seekstart=0, seekend=0, listonly=False, contentasfile=True, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
1733
1735
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
1734
1736
|
delimiter = formatspecs['format_delimiter'];
|
|
1735
1737
|
curloc = fp.tell();
|
|
@@ -1810,7 +1812,7 @@ def ReadFileDataBySizeWithContentToArray(fp, seekstart=0, seekend=0, listonly=Fa
|
|
|
1810
1812
|
realidnum = 0;
|
|
1811
1813
|
countnum = seekstart;
|
|
1812
1814
|
while(countnum < seekend):
|
|
1813
|
-
HeaderOut = ReadFileHeaderDataBySizeWithContentToArray(fp, listonly, uncompress, skipchecksum, formatspecs);
|
|
1815
|
+
HeaderOut = ReadFileHeaderDataBySizeWithContentToArray(fp, listonly, contentasfile, uncompress, skipchecksum, formatspecs);
|
|
1814
1816
|
if(len(HeaderOut)==0):
|
|
1815
1817
|
break;
|
|
1816
1818
|
HeaderOut.update({'fid': realidnum, 'fidalt': realidnum});
|
|
@@ -1912,7 +1914,7 @@ def ReadFileDataBySizeWithContentToList(fp, seekstart=0, seekend=0, listonly=Fal
|
|
|
1912
1914
|
realidnum = realidnum + 1;
|
|
1913
1915
|
return catlist;
|
|
1914
1916
|
|
|
1915
|
-
def ReadInFileBySizeWithContentToArray(infile, seekstart=0, seekend=0, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
1917
|
+
def ReadInFileBySizeWithContentToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
1916
1918
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
1917
1919
|
delimiter = formatspecs['format_delimiter'];
|
|
1918
1920
|
if(hasattr(infile, "read") or hasattr(infile, "write")):
|
|
@@ -1972,7 +1974,7 @@ def ReadInFileBySizeWithContentToArray(infile, seekstart=0, seekend=0, listonly=
|
|
|
1972
1974
|
if(not compresscheck):
|
|
1973
1975
|
return False;
|
|
1974
1976
|
fp = UncompressFile(infile, formatspecs, "rb");
|
|
1975
|
-
return ReadFileDataBySizeWithContentToArray(fp, seekstart, seekend, listonly, uncompress, skipchecksum, formatspecs);
|
|
1977
|
+
return ReadFileDataBySizeWithContentToArray(fp, seekstart, seekend, listonly, contentasfile, uncompress, skipchecksum, formatspecs);
|
|
1976
1978
|
|
|
1977
1979
|
def ReadInFileBySizeWithContentToList(infile, seekstart=0, seekend=0, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__):
|
|
1978
1980
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
@@ -4522,7 +4524,7 @@ def PackArchiveFileFromInFile(infile, outfile, compression="auto", compresswhole
|
|
|
4522
4524
|
|
|
4523
4525
|
create_alias_function("Pack", __file_format_name__, "FromInFile", PackArchiveFileFromInFile);
|
|
4524
4526
|
|
|
4525
|
-
def ArchiveFileSeekToFileNum(infile, seekto=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
4527
|
+
def ArchiveFileSeekToFileNum(infile, seekto=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
4526
4528
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
4527
4529
|
if(hasattr(infile, "read") or hasattr(infile, "write")):
|
|
4528
4530
|
catfp = infile;
|
|
@@ -4530,13 +4532,13 @@ def ArchiveFileSeekToFileNum(infile, seekto=0, listonly=False, skipchecksum=Fals
|
|
|
4530
4532
|
catfp = UncompressArchiveFile(catfp, formatspecs);
|
|
4531
4533
|
checkcompressfile = CheckCompressionSubType(catfp, formatspecs, True);
|
|
4532
4534
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
4533
|
-
return TarFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4535
|
+
return TarFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4534
4536
|
if(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
4535
|
-
return ZipFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4537
|
+
return ZipFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4536
4538
|
if(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
4537
|
-
return RarFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4539
|
+
return RarFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4538
4540
|
if(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
4539
|
-
return SevenZipFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4541
|
+
return SevenZipFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4540
4542
|
if(checkcompressfile!="catfile" and checkcompressfile!=formatspecs['format_lower']):
|
|
4541
4543
|
return False;
|
|
4542
4544
|
if(not catfp):
|
|
@@ -4564,13 +4566,13 @@ def ArchiveFileSeekToFileNum(infile, seekto=0, listonly=False, skipchecksum=Fals
|
|
|
4564
4566
|
infile = RemoveWindowsPath(infile);
|
|
4565
4567
|
checkcompressfile = CheckCompressionSubType(infile, formatspecs, True);
|
|
4566
4568
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
4567
|
-
return TarFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4569
|
+
return TarFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4568
4570
|
if(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
4569
|
-
return ZipFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4571
|
+
return ZipFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4570
4572
|
if(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
4571
|
-
return RarFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4573
|
+
return RarFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4572
4574
|
if(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
4573
|
-
return SevenZipFileToArray(infile, seekto, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4575
|
+
return SevenZipFileToArray(infile, seekto, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4574
4576
|
if(checkcompressfile!="catfile" and checkcompressfile!=formatspecs['format_lower']):
|
|
4575
4577
|
return False;
|
|
4576
4578
|
compresscheck = CheckCompressionType(infile, formatspecs, True);
|
|
@@ -4755,7 +4757,7 @@ def ArchiveFileSeekToFileNum(infile, seekto=0, listonly=False, skipchecksum=Fals
|
|
|
4755
4757
|
|
|
4756
4758
|
create_alias_function("", __file_format_name__, "SeekToFileNum", ArchiveFileSeekToFileNum);
|
|
4757
4759
|
|
|
4758
|
-
def ArchiveFileSeekToFileName(infile, seekfile=None, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
4760
|
+
def ArchiveFileSeekToFileName(infile, seekfile=None, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
4759
4761
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
4760
4762
|
if(hasattr(infile, "read") or hasattr(infile, "write")):
|
|
4761
4763
|
catfp = infile;
|
|
@@ -4763,13 +4765,13 @@ def ArchiveFileSeekToFileName(infile, seekfile=None, listonly=False, skipchecksu
|
|
|
4763
4765
|
catfp = UncompressArchiveFile(catfp, formatspecs);
|
|
4764
4766
|
checkcompressfile = CheckCompressionSubType(catfp, formatspecs, True);
|
|
4765
4767
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
4766
|
-
return TarFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4768
|
+
return TarFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4767
4769
|
if(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
4768
|
-
return ZipFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4770
|
+
return ZipFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4769
4771
|
if(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
4770
|
-
return RarFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4772
|
+
return RarFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4771
4773
|
if(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
4772
|
-
return SevenZipFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4774
|
+
return SevenZipFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4773
4775
|
if(checkcompressfile!="catfile" and checkcompressfile!=formatspecs['format_lower']):
|
|
4774
4776
|
return False;
|
|
4775
4777
|
if(not catfp):
|
|
@@ -4797,13 +4799,13 @@ def ArchiveFileSeekToFileName(infile, seekfile=None, listonly=False, skipchecksu
|
|
|
4797
4799
|
infile = RemoveWindowsPath(infile);
|
|
4798
4800
|
checkcompressfile = CheckCompressionSubType(infile, formatspecs, True);
|
|
4799
4801
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
4800
|
-
return TarFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4802
|
+
return TarFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4801
4803
|
if(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
4802
|
-
return ZipFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4804
|
+
return ZipFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4803
4805
|
if(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
4804
|
-
return RarFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4806
|
+
return RarFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4805
4807
|
if(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
4806
|
-
return SevenZipFileToArray(infile, 0, 0, listonly, skipchecksum, formatspecs, returnfp);
|
|
4808
|
+
return SevenZipFileToArray(infile, 0, 0, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
4807
4809
|
if(checkcompressfile!="catfile" and checkcompressfile!=formatspecs['format_lower']):
|
|
4808
4810
|
return False;
|
|
4809
4811
|
compresscheck = CheckCompressionType(infile, formatspecs, True);
|
|
@@ -5008,13 +5010,13 @@ def ArchiveFileValidate(infile, formatspecs=__file_format_dict__, verbose=False,
|
|
|
5008
5010
|
catfp = UncompressArchiveFile(catfp, formatspecs);
|
|
5009
5011
|
checkcompressfile = CheckCompressionSubType(catfp, formatspecs, True);
|
|
5010
5012
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
5011
|
-
return TarFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5013
|
+
return TarFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5012
5014
|
if(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
5013
|
-
return ZipFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5015
|
+
return ZipFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5014
5016
|
if(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
5015
|
-
return RarFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5017
|
+
return RarFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5016
5018
|
if(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
5017
|
-
return SevenZipFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5019
|
+
return SevenZipFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5018
5020
|
if(checkcompressfile!="catfile" and checkcompressfile!=formatspecs['format_lower']):
|
|
5019
5021
|
return False;
|
|
5020
5022
|
if(not catfp):
|
|
@@ -5042,13 +5044,13 @@ def ArchiveFileValidate(infile, formatspecs=__file_format_dict__, verbose=False,
|
|
|
5042
5044
|
infile = RemoveWindowsPath(infile);
|
|
5043
5045
|
checkcompressfile = CheckCompressionSubType(infile, formatspecs, True);
|
|
5044
5046
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
5045
|
-
return TarFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5047
|
+
return TarFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5046
5048
|
if(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
5047
|
-
return ZipFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5049
|
+
return ZipFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5048
5050
|
if(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
5049
|
-
return RarFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5051
|
+
return RarFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5050
5052
|
if(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
5051
|
-
return SevenZipFileToArray(infile, 0, 0, False, False, formatspecs, returnfp);
|
|
5053
|
+
return SevenZipFileToArray(infile, 0, 0, False, True, False, formatspecs, returnfp);
|
|
5052
5054
|
if(checkcompressfile!="catfile" and checkcompressfile!=formatspecs['format_lower']):
|
|
5053
5055
|
return False;
|
|
5054
5056
|
compresscheck = CheckCompressionType(infile, formatspecs, True);
|
|
@@ -5250,7 +5252,7 @@ def ArchiveFileValidate(infile, formatspecs=__file_format_dict__, verbose=False,
|
|
|
5250
5252
|
|
|
5251
5253
|
create_alias_function("", __file_format_name__, "Validate", ArchiveFileValidate);
|
|
5252
5254
|
|
|
5253
|
-
def ArchiveFileToArray(infile, seekstart=0, seekend=0, listonly=False, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5255
|
+
def ArchiveFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, uncompress=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5254
5256
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5255
5257
|
if(hasattr(infile, "read") or hasattr(infile, "write")):
|
|
5256
5258
|
catfp = infile;
|
|
@@ -5258,13 +5260,13 @@ def ArchiveFileToArray(infile, seekstart=0, seekend=0, listonly=False, uncompres
|
|
|
5258
5260
|
catfp = UncompressArchiveFile(catfp, formatspecs);
|
|
5259
5261
|
checkcompressfile = CheckCompressionSubType(catfp, formatspecs, True);
|
|
5260
5262
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
5261
|
-
return TarFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5263
|
+
return TarFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5262
5264
|
if(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
5263
|
-
return ZipFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5265
|
+
return ZipFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5264
5266
|
if(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
5265
|
-
return RarFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5267
|
+
return RarFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5266
5268
|
if(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
5267
|
-
return SevenZipFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5269
|
+
return SevenZipFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5268
5270
|
if(checkcompressfile!="catfile" and checkcompressfile!=formatspecs['format_lower']):
|
|
5269
5271
|
return False;
|
|
5270
5272
|
if(not catfp):
|
|
@@ -5549,7 +5551,9 @@ def ArchiveFileToArray(infile, seekstart=0, seekend=0, listonly=False, uncompres
|
|
|
5549
5551
|
else:
|
|
5550
5552
|
return False;
|
|
5551
5553
|
catfcontents.seek(0, 0);
|
|
5552
|
-
|
|
5554
|
+
if(not contentasfile):
|
|
5555
|
+
catfcontents = catfcontents.read();
|
|
5556
|
+
catlist['ffilelist'].append({'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, 'fcompression': catfcompression, 'fcsize': catfcsize, 'fuid': catfuid, 'funame': catfuname, 'fgid': catfgid, 'fgname': catfgname, 'finode': catfinode, 'flinkcount': catflinkcount, 'fminor': catfdev_minor, 'fmajor': catfdev_major, 'frminor': catfrdev_minor, 'frmajor': catfrdev_major, 'fseeknextfile': catfseeknextfile, 'fheaderchecksumtype': catheaderdata[-4], 'fcontentchecksumtype': catheaderdata[-3], 'fnumfields': catfnumfields + 2, 'frawheader': catheaderdata, 'fextrafields': catfextrafields, 'fextrafieldsize': catfextrasize, 'fextralist': extrafieldslist, 'fheaderchecksum': catfcs, 'fcontentchecksum': catfccs, 'fhascontents': pyhascontents, 'fcontentstart': catfcontentstart, 'fcontentend': catfcontentend, 'fcontentasfile': contentasfile, 'fcontents': catfcontents});
|
|
5553
5557
|
fileidnum = fileidnum + 1;
|
|
5554
5558
|
realidnum = realidnum + 1;
|
|
5555
5559
|
if(returnfp):
|
|
@@ -5560,70 +5564,70 @@ def ArchiveFileToArray(infile, seekstart=0, seekend=0, listonly=False, uncompres
|
|
|
5560
5564
|
|
|
5561
5565
|
create_alias_function("", __file_format_name__, "ToArray", ArchiveFileToArray);
|
|
5562
5566
|
|
|
5563
|
-
def ArchiveFileStringToArray(catstr, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5567
|
+
def ArchiveFileStringToArray(catstr, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5564
5568
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5565
5569
|
catfp = BytesIO(catstr);
|
|
5566
|
-
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, True, skipchecksum, formatspecs, returnfp);
|
|
5570
|
+
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, contentasfile, True, skipchecksum, formatspecs, returnfp);
|
|
5567
5571
|
return listcatfiles;
|
|
5568
5572
|
|
|
5569
5573
|
create_alias_function("", __file_format_name__, "StringToArray", ArchiveFileStringToArray);
|
|
5570
5574
|
|
|
5571
|
-
def TarFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5575
|
+
def TarFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5572
5576
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5573
5577
|
catfp = BytesIO();
|
|
5574
5578
|
catfp = PackArchiveFileFromTarFile(infile, catfp, "auto", True, None, "crc32", [], formatspecs, False, True);
|
|
5575
|
-
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, True, skipchecksum, formatspecs, returnfp);
|
|
5579
|
+
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, contentasfile, True, skipchecksum, formatspecs, returnfp);
|
|
5576
5580
|
return listcatfiles;
|
|
5577
5581
|
|
|
5578
|
-
def ZipFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5582
|
+
def ZipFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5579
5583
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5580
5584
|
catfp = BytesIO();
|
|
5581
5585
|
catfp = PackArchiveFileFromZipFile(infile, catfp, "auto", True, None, "crc32", [], formatspecs, False, True);
|
|
5582
|
-
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, True, skipchecksum, formatspecs, returnfp);
|
|
5586
|
+
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, contentasfile, True, skipchecksum, formatspecs, returnfp);
|
|
5583
5587
|
return listcatfiles;
|
|
5584
5588
|
|
|
5585
5589
|
if(not rarfile_support):
|
|
5586
|
-
def RarFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5590
|
+
def RarFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5587
5591
|
return False;
|
|
5588
5592
|
|
|
5589
5593
|
if(rarfile_support):
|
|
5590
|
-
def RarFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5594
|
+
def RarFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5591
5595
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5592
5596
|
catfp = BytesIO();
|
|
5593
5597
|
catfp = PackArchiveFileFromSevenZipFile(infile, catfp, "auto", True, None, "crc32", [], formatspecs, False, True);
|
|
5594
|
-
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, True, skipchecksum, formatspecs, returnfp);
|
|
5598
|
+
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, contentasfile, True, skipchecksum, formatspecs, returnfp);
|
|
5595
5599
|
return listcatfiles;
|
|
5596
5600
|
|
|
5597
5601
|
if(not py7zr_support):
|
|
5598
|
-
def SevenZipFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5602
|
+
def SevenZipFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5599
5603
|
return False;
|
|
5600
5604
|
|
|
5601
5605
|
if(py7zr_support):
|
|
5602
|
-
def SevenZipFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5606
|
+
def SevenZipFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5603
5607
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5604
5608
|
catfp = BytesIO();
|
|
5605
5609
|
catfp = PackArchiveFileFromSevenZipFile(infile, catfp, "auto", True, None, "crc32", [], formatspecs, False, True);
|
|
5606
|
-
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, True, skipchecksum, formatspecs, returnfp);
|
|
5610
|
+
listcatfiles = ArchiveFileToArray(catfp, seekstart, seekend, listonly, contentasfile, True, skipchecksum, formatspecs, returnfp);
|
|
5607
5611
|
return listcatfiles;
|
|
5608
5612
|
|
|
5609
|
-
def InFileToArray(infile, seekstart=0, seekend=0, listonly=False, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5613
|
+
def InFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_dict__, returnfp=False):
|
|
5610
5614
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5611
5615
|
checkcompressfile = CheckCompressionSubType(infile, formatspecs, True);
|
|
5612
5616
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
5613
|
-
return TarFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5617
|
+
return TarFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5614
5618
|
elif(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
5615
|
-
return ZipFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5619
|
+
return ZipFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5616
5620
|
elif(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
5617
|
-
return RarFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5621
|
+
return RarFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5618
5622
|
elif(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
5619
|
-
return SevenZipFileToArray(infile, seekstart, seekend, listonly, skipchecksum, formatspecs, returnfp);
|
|
5623
|
+
return SevenZipFileToArray(infile, seekstart, seekend, listonly, contentasfile, skipchecksum, formatspecs, returnfp);
|
|
5620
5624
|
elif(checkcompressfile=="catfile"):
|
|
5621
|
-
return ArchiveFileToArray(infile, seekstart, seekend, listonly, True, skipchecksum, formatspecs, returnfp);
|
|
5625
|
+
return ArchiveFileToArray(infile, seekstart, seekend, listonly, contentasfile, True, skipchecksum, formatspecs, returnfp);
|
|
5622
5626
|
else:
|
|
5623
5627
|
return False;
|
|
5624
5628
|
return False;
|
|
5625
5629
|
|
|
5626
|
-
def ListDirToArrayAlt(infiles, dirlistfromtxt=False, followlink=False, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
5630
|
+
def ListDirToArrayAlt(infiles, dirlistfromtxt=False, followlink=False, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
5627
5631
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5628
5632
|
catver = formatspecs['format_ver'];
|
|
5629
5633
|
fileheaderver = str(int(catver.replace(".", "")));
|
|
@@ -5854,11 +5858,13 @@ def ListDirToArrayAlt(infiles, dirlistfromtxt=False, followlink=False, listonly=
|
|
|
5854
5858
|
fcontents = BytesIO();
|
|
5855
5859
|
pyhascontents = False;
|
|
5856
5860
|
fcontents.seek(0, 0);
|
|
5857
|
-
|
|
5861
|
+
if(not contentasfile):
|
|
5862
|
+
fcontents = fcontents.read();
|
|
5863
|
+
catlist['ffilelist'].append({'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, 'fcompression': fcompression, 'fcsize': fcsize, 'fuid': fuid, 'funame': funame, 'fgid': fgid, 'fgname': fgname, 'finode': finode, 'flinkcount': flinkcount, 'fminor': fdev_minor, 'fmajor': fdev_major, 'frminor': frdev_minor, 'frmajor': frdev_major, 'fseeknextfile': "+1", 'fheaderchecksumtype': checksumtype, 'fcontentchecksumtype': 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, 'fcontentasfile': contentasfile, 'fcontents': fcontents});
|
|
5858
5864
|
fileidnum = fileidnum + 1;
|
|
5859
5865
|
return catlist;
|
|
5860
5866
|
|
|
5861
|
-
def TarFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
5867
|
+
def TarFileToArrayAlt(infile, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
5862
5868
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
5863
5869
|
curinode = 0;
|
|
5864
5870
|
curfid = 0;
|
|
@@ -6040,11 +6046,13 @@ def TarFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[]
|
|
|
6040
6046
|
fcontents = BytesIO();
|
|
6041
6047
|
pyhascontents = False;
|
|
6042
6048
|
fcontents.seek(0, 0);
|
|
6043
|
-
|
|
6049
|
+
if(not contentasfile):
|
|
6050
|
+
fcontents = fcontents.read();
|
|
6051
|
+
catlist['ffilelist'].append({'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, 'fcompression': fcompression, 'fcsize': fcsize, 'fuid': fuid, 'funame': funame, 'fgid': fgid, 'fgname': fgname, 'finode': finode, 'flinkcount': flinkcount, 'fminor': fdev_minor, 'fmajor': fdev_major, 'frminor': frdev_minor, 'frmajor': frdev_major, 'fseeknextfile': "+1", 'fheaderchecksumtype': checksumtype, 'fcontentchecksumtype': 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, 'fcontentasfile': contentasfile, 'fcontents': fcontents});
|
|
6044
6052
|
fileidnum = fileidnum + 1;
|
|
6045
6053
|
return catlist;
|
|
6046
6054
|
|
|
6047
|
-
def ZipFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6055
|
+
def ZipFileToArrayAlt(infile, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6048
6056
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
6049
6057
|
curinode = 0;
|
|
6050
6058
|
curfid = 0;
|
|
@@ -6251,16 +6259,18 @@ def ZipFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[]
|
|
|
6251
6259
|
fcontents = BytesIO();
|
|
6252
6260
|
pyhascontents = False;
|
|
6253
6261
|
fcontents.seek(0, 0);
|
|
6254
|
-
|
|
6262
|
+
if(not contentasfile):
|
|
6263
|
+
fcontents = fcontents.read();
|
|
6264
|
+
catlist['ffilelist'].append({'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, 'fcompression': fcompression, 'fcsize': fcsize, 'fuid': fuid, 'funame': funame, 'fgid': fgid, 'fgname': fgname, 'finode': finode, 'flinkcount': flinkcount, 'fminor': fdev_minor, 'fmajor': fdev_major, 'frminor': frdev_minor, 'frmajor': frdev_major, 'fseeknextfile': "+1", 'fheaderchecksumtype': checksumtype, 'fcontentchecksumtype': 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, 'fcontentasfile': contentasfile, 'fcontents': fcontents});
|
|
6255
6265
|
fileidnum = fileidnum + 1;
|
|
6256
6266
|
return catlist;
|
|
6257
6267
|
|
|
6258
6268
|
if(not rarfile_support):
|
|
6259
|
-
def RarFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6269
|
+
def RarFileToArrayAlt(infile, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6260
6270
|
return False;
|
|
6261
6271
|
|
|
6262
6272
|
if(rarfile_support):
|
|
6263
|
-
def RarFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6273
|
+
def RarFileToArrayAlt(infile, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6264
6274
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
6265
6275
|
curinode = 0;
|
|
6266
6276
|
curfid = 0;
|
|
@@ -6475,16 +6485,18 @@ if(rarfile_support):
|
|
|
6475
6485
|
fcontents = BytesIO();
|
|
6476
6486
|
pyhascontents = False;
|
|
6477
6487
|
fcontents.seek(0, 0);
|
|
6478
|
-
|
|
6488
|
+
if(not contentasfile):
|
|
6489
|
+
fcontents = fcontents.read();
|
|
6490
|
+
catlist['ffilelist'].append({'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, 'fcompression': fcompression, 'fcsize': fcsize, 'fuid': fuid, 'funame': funame, 'fgid': fgid, 'fgname': fgname, 'finode': finode, 'flinkcount': flinkcount, 'fminor': fdev_minor, 'fmajor': fdev_major, 'frminor': frdev_minor, 'frmajor': frdev_major, 'fseeknextfile': "+1", 'fheaderchecksumtype': checksumtype, 'fcontentchecksumtype': 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, 'fcontentasfile': contentasfile, 'fcontents': fcontents});
|
|
6479
6491
|
fileidnum = fileidnum + 1;
|
|
6480
6492
|
return catlist;
|
|
6481
6493
|
|
|
6482
6494
|
if(not py7zr_support):
|
|
6483
|
-
def SevenZipFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6495
|
+
def SevenZipFileToArrayAlt(infile, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6484
6496
|
return False;
|
|
6485
6497
|
|
|
6486
6498
|
if(py7zr_support):
|
|
6487
|
-
def SevenZipFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6499
|
+
def SevenZipFileToArrayAlt(infile, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6488
6500
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
6489
6501
|
curinode = 0;
|
|
6490
6502
|
curfid = 0;
|
|
@@ -6644,23 +6656,25 @@ if(py7zr_support):
|
|
|
6644
6656
|
fcontents = BytesIO();
|
|
6645
6657
|
pyhascontents = False;
|
|
6646
6658
|
fcontents.seek(0, 0);
|
|
6647
|
-
|
|
6659
|
+
if(not contentasfile):
|
|
6660
|
+
fcontents = fcontents.read();
|
|
6661
|
+
catlist['ffilelist'].append({'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, 'fcompression': fcompression, 'fcsize': fcsize, 'fuid': fuid, 'funame': funame, 'fgid': fgid, 'fgname': fgname, 'finode': finode, 'flinkcount': flinkcount, 'fminor': fdev_minor, 'fmajor': fdev_major, 'frminor': frdev_minor, 'frmajor': frdev_major, 'fseeknextfile': "+1", 'fheaderchecksumtype': checksumtype, 'fcontentchecksumtype': 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, 'fcontentasfile': contentasfile, 'fcontents': fcontents});
|
|
6648
6662
|
fileidnum = fileidnum + 1;
|
|
6649
6663
|
return catlist;
|
|
6650
6664
|
|
|
6651
|
-
def InFileToArrayAlt(infile, listonly=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6665
|
+
def InFileToArrayAlt(infile, listonly=False, contentasfile=True, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False):
|
|
6652
6666
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
6653
6667
|
checkcompressfile = CheckCompressionSubType(infile, formatspecs, True);
|
|
6654
6668
|
if(checkcompressfile=="tarfile" and TarFileCheck(infile)):
|
|
6655
|
-
return TarFileToArrayAlt(infile, listonly, checksumtype, extradata, formatspecs, verbose);
|
|
6669
|
+
return TarFileToArrayAlt(infile, listonly, contentasfile, checksumtype, extradata, formatspecs, verbose);
|
|
6656
6670
|
elif(checkcompressfile=="zipfile" and zipfile.is_zipfile(infile)):
|
|
6657
|
-
return ZipFileToArrayAlt(infile, listonly, checksumtype, extradata, formatspecs, verbose);
|
|
6671
|
+
return ZipFileToArrayAlt(infile, listonly, contentasfile, checksumtype, extradata, formatspecs, verbose);
|
|
6658
6672
|
elif(rarfile_support and checkcompressfile=="rarfile" and (rarfile.is_rarfile(infile) or rarfile.is_rarfile_sfx(infile))):
|
|
6659
|
-
return RarFileToArrayAlt(infile, listonly, checksumtype, extradata, formatspecs, verbose);
|
|
6673
|
+
return RarFileToArrayAlt(infile, listonly, contentasfile, checksumtype, extradata, formatspecs, verbose);
|
|
6660
6674
|
elif(py7zr_support and checkcompressfile=="7zipfile" and py7zr.is_7zfile(infile)):
|
|
6661
|
-
return SevenZipFileToArrayAlt(infile, listonly, checksumtype, extradata, formatspecs, verbose);
|
|
6675
|
+
return SevenZipFileToArrayAlt(infile, listonly, contentasfile, checksumtype, extradata, formatspecs, verbose);
|
|
6662
6676
|
elif(checkcompressfile=="catfile"):
|
|
6663
|
-
return ArchiveFileToArray(infile, 0, 0, listonly, True, False, formatspecs, False);
|
|
6677
|
+
return ArchiveFileToArray(infile, 0, 0, listonly, contentasfile, True, False, formatspecs, False);
|
|
6664
6678
|
else:
|
|
6665
6679
|
return False;
|
|
6666
6680
|
return False;
|
|
@@ -6829,6 +6843,8 @@ def RePackArchiveFile(infile, outfile, compression="auto", compresswholefile=Tru
|
|
|
6829
6843
|
if(not followlink and len(extradata)<0):
|
|
6830
6844
|
extradata = listcatfiles['ffilelist'][reallcfi]['fextralist'];
|
|
6831
6845
|
fcontents = listcatfiles['ffilelist'][reallcfi]['fcontents'];
|
|
6846
|
+
if(not listcatfiles['ffilelist'][reallcfi]['fcontentasfile']):
|
|
6847
|
+
fcontents = BytesIO(fcontents);
|
|
6832
6848
|
fcompression = "";
|
|
6833
6849
|
fcsize = format(int(0), 'x').lower();
|
|
6834
6850
|
if(not compresswholefile):
|
|
@@ -6902,6 +6918,8 @@ def RePackArchiveFile(infile, outfile, compression="auto", compresswholefile=Tru
|
|
|
6902
6918
|
if(len(extradata)<0):
|
|
6903
6919
|
extradata = flinkinfo['fextralist'];
|
|
6904
6920
|
fcontents = flinkinfo['fcontents'];
|
|
6921
|
+
if(not flinkinfo['fcontentasfile']):
|
|
6922
|
+
fcontents = BytesIO(fcontents);
|
|
6905
6923
|
ftypehex = format(flinkinfo['ftype'], 'x').lower();
|
|
6906
6924
|
else:
|
|
6907
6925
|
ftypehex = format(listcatfiles['ffilelist'][reallcfi]['ftype'], 'x').lower();
|
|
@@ -7021,6 +7039,8 @@ def UnPackArchiveFile(infile, outdir=None, followlink=False, seekstart=0, seeken
|
|
|
7021
7039
|
VerbosePrintOut(PrependPath(outdir, listcatfiles['ffilelist'][lcfi]['fname']));
|
|
7022
7040
|
if(listcatfiles['ffilelist'][lcfi]['ftype']==0 or listcatfiles['ffilelist'][lcfi]['ftype']==7):
|
|
7023
7041
|
with open(PrependPath(outdir, listcatfiles['ffilelist'][lcfi]['fname']), "wb") as fpc:
|
|
7042
|
+
if(not listcatfiles['ffilelist'][lcfi]['fcontentasfile']):
|
|
7043
|
+
listcatfiles['ffilelist'][lcfi]['fcontents'] = BytesIO(listcatfiles['ffilelist'][lcfi]['fcontents']);
|
|
7024
7044
|
listcatfiles['ffilelist'][lcfi]['fcontents'].seek(0, 0);
|
|
7025
7045
|
shutil.copyfileobj(listcatfiles['ffilelist'][lcfi]['fcontents'], fpc);
|
|
7026
7046
|
try:
|
|
@@ -7065,6 +7085,8 @@ def UnPackArchiveFile(infile, outdir=None, followlink=False, seekstart=0, seeken
|
|
|
7065
7085
|
fgname = "";
|
|
7066
7086
|
if(flinkinfo['ftype']==0 or flinkinfo['ftype']==7):
|
|
7067
7087
|
with open(PrependPath(outdir, listcatfiles['ffilelist'][lcfi]['fname']), "wb") as fpc:
|
|
7088
|
+
if(not flinkinfo['fcontentasfile']):
|
|
7089
|
+
flinkinfo['fcontents'] = BytesIO(flinkinfo['fcontents']);
|
|
7068
7090
|
flinkinfo['fcontents'].seek(0, 0);
|
|
7069
7091
|
shutil.copyfileobj(flinkinfo['fcontents'], fpc);
|
|
7070
7092
|
try:
|
|
@@ -7128,6 +7150,8 @@ def UnPackArchiveFile(infile, outdir=None, followlink=False, seekstart=0, seeken
|
|
|
7128
7150
|
fgname = "";
|
|
7129
7151
|
if(flinkinfo['ftype']==0 or flinkinfo['ftype']==7):
|
|
7130
7152
|
with open(PrependPath(outdir, listcatfiles['ffilelist'][lcfi]['fname']), "wb") as fpc:
|
|
7153
|
+
if(not flinkinfo['fcontentasfile']):
|
|
7154
|
+
flinkinfo['fcontents'] = BytesIO(flinkinfo['fcontents']);
|
|
7131
7155
|
flinkinfo['fcontents'].seek(0, 0);
|
|
7132
7156
|
shutil.copyfileobj(flinkinfo['fcontents'], fpc);
|
|
7133
7157
|
try:
|
|
@@ -7729,15 +7753,15 @@ def ListDirListFiles(infiles, dirlistfromtxt=False, compression="auto", compress
|
|
|
7729
7753
|
listcatfiles = ArchiveFileListFiles(outarray, seekstart, seekend, skipchecksum, formatspecs, verbose, returnfp);
|
|
7730
7754
|
return listcatfiles;
|
|
7731
7755
|
|
|
7732
|
-
def ListDirListFilesAlt(infiles, dirlistfromtxt=False, followlink=False, listonly=False, seekstart=0, seekend=0, skipchecksum=False, checksumtype="crc32", formatspecs=__file_format_dict__, verbose=False, returnfp=False):
|
|
7756
|
+
def ListDirListFilesAlt(infiles, dirlistfromtxt=False, followlink=False, listonly=False, contentasfile=True, seekstart=0, seekend=0, skipchecksum=False, checksumtype="crc32", formatspecs=__file_format_dict__, verbose=False, returnfp=False):
|
|
7733
7757
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
7734
|
-
outarray = ListDirToArrayAlt(infiles, dirlistfromtxt, followlink, listonly, checksumtype, formatspecs, verbose);
|
|
7758
|
+
outarray = ListDirToArrayAlt(infiles, dirlistfromtxt, followlink, listonly, contentasfile, checksumtype, formatspecs, verbose);
|
|
7735
7759
|
listcatfiles = ArchiveFileListFiles(outarray, seekstart, seekend, skipchecksum, formatspecs, verbose, returnfp);
|
|
7736
7760
|
return listcatfiles;
|
|
7737
7761
|
|
|
7738
7762
|
def PackArchiveFileFromListDirAlt(infiles, outfile, dirlistfromtxt=False, compression="auto", compresswholefile=True, compressionlevel=None, followlink=False, skipchecksum=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False, returnfp=False):
|
|
7739
7763
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
7740
|
-
outarray = ListDirToArrayAlt(infiles, dirlistfromtxt, followlink, False, checksumtype, extradata, formatspecs, False);
|
|
7764
|
+
outarray = ListDirToArrayAlt(infiles, dirlistfromtxt, followlink, False, True, checksumtype, extradata, formatspecs, False);
|
|
7741
7765
|
listcatfiles = RePackArchiveFile(outarray, outfile, compression, compresswholefile, compressionlevel, followlink, checksumtype, skipchecksum, extradata, formatspecs, verbose, returnfp);
|
|
7742
7766
|
return listcatfiles;
|
|
7743
7767
|
|
|
@@ -7745,7 +7769,7 @@ create_alias_function("Pack", __file_format_name__, "FromListDirAlt", PackArchiv
|
|
|
7745
7769
|
|
|
7746
7770
|
def PackArchiveFileFromTarFileAlt(infile, outfile, compression="auto", compresswholefile=True, compressionlevel=None, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False, returnfp=False):
|
|
7747
7771
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
7748
|
-
outarray = TarFileToArrayAlt(infile, False, checksumtype, extradata, formatspecs, False);
|
|
7772
|
+
outarray = TarFileToArrayAlt(infile, False, True, checksumtype, extradata, formatspecs, False);
|
|
7749
7773
|
listcatfiles = RePackArchiveFile(outarray, outfile, compression, compresswholefile, compressionlevel, False, checksumtype, False, extradata, formatspecs, verbose, returnfp);
|
|
7750
7774
|
return listcatfiles;
|
|
7751
7775
|
|
|
@@ -7753,7 +7777,7 @@ create_alias_function("Pack", __file_format_name__, "FromTarFileAlt", PackArchiv
|
|
|
7753
7777
|
|
|
7754
7778
|
def PackArchiveFileFromZipFileAlt(infile, outfile, compression="auto", compresswholefile=True, compressionlevel=None, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False, returnfp=False):
|
|
7755
7779
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
7756
|
-
outarray = ZipFileToArrayAlt(infile, False, checksumtype, extradata, formatspecs, False);
|
|
7780
|
+
outarray = ZipFileToArrayAlt(infile, False, True, checksumtype, extradata, formatspecs, False);
|
|
7757
7781
|
listcatfiles = RePackArchiveFile(outarray, outfile, compression, compresswholefile, compressionlevel, False, checksumtype, False, extradata, formatspecs, verbose, returnfp);
|
|
7758
7782
|
return listcatfiles;
|
|
7759
7783
|
|
|
@@ -7766,7 +7790,7 @@ if(not rarfile_support):
|
|
|
7766
7790
|
if(rarfile_support):
|
|
7767
7791
|
def PackArchiveFileFromRarFileAlt(infile, outfile, compression="auto", compresswholefile=True, compressionlevel=None, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False, returnfp=False):
|
|
7768
7792
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
7769
|
-
outarray = RarFileToArrayAlt(infile, False, checksumtype, extradata, formatspecs, False);
|
|
7793
|
+
outarray = RarFileToArrayAlt(infile, False, True, checksumtype, extradata, formatspecs, False);
|
|
7770
7794
|
listcatfiles = RePackArchiveFile(outarray, outfile, compression, compresswholefile, compressionlevel, False, checksumtype, False, extradata, formatspecs, verbose, returnfp);
|
|
7771
7795
|
return listcatfiles;
|
|
7772
7796
|
|
|
@@ -7779,7 +7803,7 @@ if(not py7zr_support):
|
|
|
7779
7803
|
if(py7zr_support):
|
|
7780
7804
|
def PackArchiveFileFromSevenZipFileAlt(infile, outfile, compression="auto", compresswholefile=True, compressionlevel=None, checksumtype="crc32", extradata=[], formatspecs=__file_format_dict__, verbose=False, returnfp=False):
|
|
7781
7805
|
formatspecs = FormatSpecsListToDict(formatspecs);
|
|
7782
|
-
outarray = SevenZipFileToArrayAlt(infile, False, checksumtype, extradata, formatspecs, False);
|
|
7806
|
+
outarray = SevenZipFileToArrayAlt(infile, False, True, checksumtype, extradata, formatspecs, False);
|
|
7783
7807
|
listcatfiles = RePackArchiveFile(outarray, outfile, compression, compresswholefile, compressionlevel, False, checksumtype, False, extradata, formatspecs, verbose, returnfp);
|
|
7784
7808
|
return listcatfiles;
|
|
7785
7809
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
Copyright 2016-2024 Game Maker 2k - http://intdb.sourceforge.net/
|
|
14
14
|
Copyright 2016-2024 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
15
15
|
|
|
16
|
-
$FileInfo: setup.py - Last Update: 6/
|
|
16
|
+
$FileInfo: setup.py - Last Update: 6/26/2024 Ver. 0.13.12 RC 1 - Author: cooldude2k $
|
|
17
17
|
'''
|
|
18
18
|
|
|
19
19
|
import os, re, sys, pkg_resources;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|