codekingpro commited on
Commit
f7ff4e4
·
verified ·
1 Parent(s): f4e8662

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +446 -0
  2. git/usr/share/perl5/core_perl/IO/Compress/Zip.pm +2291 -0
  3. git/usr/share/perl5/core_perl/IO/Socket/IP.pm +1293 -0
  4. git/usr/share/perl5/core_perl/IO/Uncompress/AnyInflate.pm +1020 -0
  5. git/usr/share/perl5/core_perl/IO/Uncompress/AnyUncompress.pm +1096 -0
  6. git/usr/share/perl5/core_perl/IO/Uncompress/Base.pm +1573 -0
  7. git/usr/share/perl5/core_perl/IO/Uncompress/Bunzip2.pm +928 -0
  8. micromamba_root/DLLs/_ctypes.pyd +3 -0
  9. micromamba_root/DLLs/_ctypes_test.pyd +3 -0
  10. micromamba_root/DLLs/_decimal.pyd +3 -0
  11. micromamba_root/DLLs/_sqlite3.pyd +3 -0
  12. micromamba_root/DLLs/_ssl.pyd +3 -0
  13. micromamba_root/DLLs/_testcapi.pyd +3 -0
  14. micromamba_root/DLLs/_testlimitedcapi.pyd +3 -0
  15. micromamba_root/DLLs/unicodedata.pyd +3 -0
  16. micromamba_root/Scripts/cppcheck-htmlreport.exe +3 -0
  17. micromamba_root/Scripts/ruff.exe +3 -0
  18. micromamba_root/libs/python3.lib +3 -0
  19. micromamba_root/libs/python314.lib +3 -0
  20. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1.conda +3 -0
  21. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/global.dat +3 -0
  22. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/af.dat +3 -0
  23. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ak.dat +3 -0
  24. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/am.dat +3 -0
  25. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ar.dat +3 -0
  26. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/as.dat +3 -0
  27. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ast.dat +3 -0
  28. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/az.dat +3 -0
  29. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bal_Latn.dat +3 -0
  30. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/be.dat +3 -0
  31. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/be_TARASK.dat +3 -0
  32. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bew.dat +3 -0
  33. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bg.dat +3 -0
  34. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/blo.dat +3 -0
  35. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bn.dat +3 -0
  36. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/br.dat +3 -0
  37. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/brx.dat +3 -0
  38. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bs.dat +3 -0
  39. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bs_Cyrl.dat +3 -0
  40. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ca.dat +3 -0
  41. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ccp.dat +3 -0
  42. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ce.dat +3 -0
  43. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ceb.dat +3 -0
  44. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/chr.dat +3 -0
  45. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cs.dat +3 -0
  46. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cv.dat +3 -0
  47. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cy.dat +3 -0
  48. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/da.dat +3 -0
  49. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/de.dat +3 -0
  50. micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/dsb.dat +3 -0
.gitattributes CHANGED
@@ -1847,3 +1847,449 @@ msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/lib/net8.0/Microsoft.Bui
1847
  msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/lib/net8.0/Microsoft.Build.Utilities.Core.pdb filter=lfs diff=lfs merge=lfs -text
1848
  msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/ref/net472/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
1849
  msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/ref/net8.0/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1847
  msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/lib/net8.0/Microsoft.Build.Utilities.Core.pdb filter=lfs diff=lfs merge=lfs -text
1848
  msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/ref/net472/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
1849
  msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/ref/net8.0/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
1850
+ msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
1851
+ msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/lib/net472/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
1852
+ msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/lib/net472/Microsoft.Build.Tasks.Core.pdb filter=lfs diff=lfs merge=lfs -text
1853
+ msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/lib/net8.0/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
1854
+ msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/lib/net8.0/Microsoft.Build.Tasks.Core.pdb filter=lfs diff=lfs merge=lfs -text
1855
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/ref/net472/MSBuild.exe filter=lfs diff=lfs merge=lfs -text
1856
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/ref/net8.0/MSBuild.dll filter=lfs diff=lfs merge=lfs -text
1857
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/contentFiles/any/net472/MSBuild.exe filter=lfs diff=lfs merge=lfs -text
1858
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/contentFiles/any/net8.0/MSBuild.dll filter=lfs diff=lfs merge=lfs -text
1859
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/contentFiles/any/net8.0/ref/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1860
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/contentFiles/any/net8.0/ref/netstandard.dll filter=lfs diff=lfs merge=lfs -text
1861
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/contentFiles/any/net472/ref/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1862
+ msbuild_packages/Microsoft.Build.Runtime.17.10.4/contentFiles/any/net472/ref/netstandard.dll filter=lfs diff=lfs merge=lfs -text
1863
+ msbuild_packages/Microsoft.Build.Framework.17.10.4/ref/net472/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1864
+ msbuild_packages/Microsoft.Build.Framework.17.10.4/ref/net8.0/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1865
+ msbuild_packages/Microsoft.Build.Framework.17.10.4/ref/netstandard2.0/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1866
+ msbuild_packages/Microsoft.Build.Framework.17.10.4/lib/net472/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1867
+ msbuild_packages/Microsoft.Build.Framework.17.10.4/lib/net472/Microsoft.Build.Framework.pdb filter=lfs diff=lfs merge=lfs -text
1868
+ msbuild_packages/Microsoft.Build.Framework.17.10.4/lib/net8.0/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1869
+ msbuild_packages/Microsoft.Build.Framework.17.10.4/lib/net8.0/Microsoft.Build.Framework.pdb filter=lfs diff=lfs merge=lfs -text
1870
+ msbuild_packages/Microsoft.Build.17.10.4/ref/net472/Microsoft.Build.dll filter=lfs diff=lfs merge=lfs -text
1871
+ msbuild_packages/Microsoft.Build.17.10.4/ref/net8.0/Microsoft.Build.dll filter=lfs diff=lfs merge=lfs -text
1872
+ msbuild_packages/Microsoft.Build.17.10.4/lib/net472/Microsoft.Build.dll filter=lfs diff=lfs merge=lfs -text
1873
+ msbuild_packages/Microsoft.Build.17.10.4/lib/net472/Microsoft.Build.pdb filter=lfs diff=lfs merge=lfs -text
1874
+ msbuild_packages/Microsoft.Build.17.10.4/lib/net8.0/Microsoft.Build.dll filter=lfs diff=lfs merge=lfs -text
1875
+ msbuild_packages/Microsoft.Build.17.10.4/lib/net8.0/Microsoft.Build.pdb filter=lfs diff=lfs merge=lfs -text
1876
+ msbuild/ref/Microsoft.Build.Framework.dll filter=lfs diff=lfs merge=lfs -text
1877
+ msbuild/ref/netstandard.dll filter=lfs diff=lfs merge=lfs -text
1878
+ micromamba_root/DLLs/unicodedata.pyd filter=lfs diff=lfs merge=lfs -text
1879
+ micromamba_root/DLLs/_ctypes.pyd filter=lfs diff=lfs merge=lfs -text
1880
+ micromamba_root/DLLs/_ctypes_test.pyd filter=lfs diff=lfs merge=lfs -text
1881
+ micromamba_root/DLLs/_decimal.pyd filter=lfs diff=lfs merge=lfs -text
1882
+ micromamba_root/DLLs/_sqlite3.pyd filter=lfs diff=lfs merge=lfs -text
1883
+ micromamba_root/DLLs/_ssl.pyd filter=lfs diff=lfs merge=lfs -text
1884
+ micromamba_root/DLLs/_testcapi.pyd filter=lfs diff=lfs merge=lfs -text
1885
+ micromamba_root/DLLs/_testlimitedcapi.pyd filter=lfs diff=lfs merge=lfs -text
1886
+ micromamba_root/libs/python3.lib filter=lfs diff=lfs merge=lfs -text
1887
+ micromamba_root/libs/python314.lib filter=lfs diff=lfs merge=lfs -text
1888
+ micromamba_root/Scripts/cppcheck-htmlreport.exe filter=lfs diff=lfs merge=lfs -text
1889
+ micromamba_root/Scripts/ruff.exe filter=lfs diff=lfs merge=lfs -text
1890
+ micromamba_root/share/Cppcheck/addons/__pycache__/misra.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
1891
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1.conda filter=lfs diff=lfs merge=lfs -text
1892
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/backrefs-7.0-pyhcf101f3_0.conda filter=lfs diff=lfs merge=lfs -text
1893
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/black-26.1.0-pyh866005b_0.conda filter=lfs diff=lfs merge=lfs -text
1894
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/black-26.3.1-pyh866005b_0.conda filter=lfs diff=lfs merge=lfs -text
1895
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/ca-certificates-2026.4.22-h4c7d964_0.conda filter=lfs diff=lfs merge=lfs -text
1896
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/certifi-2026.4.22-pyhd8ed1ab_0.conda filter=lfs diff=lfs merge=lfs -text
1897
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/jinja2-3.1.6-pyhcf101f3_1.conda filter=lfs diff=lfs merge=lfs -text
1898
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6.conda filter=lfs diff=lfs merge=lfs -text
1899
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-filesystem-2025.02.23.1-hc364b38_10.conda filter=lfs diff=lfs merge=lfs -text
1900
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-gcc-libs-13.3.0.1-hc364b38_6.conda filter=lfs diff=lfs merge=lfs -text
1901
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-libiconv-1.18.1-hc364b38_6.conda filter=lfs diff=lfs merge=lfs -text
1902
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-make-4.4.1.2-hc364b38_6.conda filter=lfs diff=lfs merge=lfs -text
1903
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-msys2-runtime-3.6.1.4-hc364b38_6.conda filter=lfs diff=lfs merge=lfs -text
1904
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1.conda filter=lfs diff=lfs merge=lfs -text
1905
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-material-9.7.6-pyhcf101f3_1.conda filter=lfs diff=lfs merge=lfs -text
1906
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pip-26.1.1-pyh8b19718_0.conda filter=lfs diff=lfs merge=lfs -text
1907
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pygments-2.20.0-pyhd8ed1ab_0.conda filter=lfs diff=lfs merge=lfs -text
1908
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pymdown-extensions-10.21.2-pyhd8ed1ab_0.conda filter=lfs diff=lfs merge=lfs -text
1909
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pytest-9.0.3-pyhc364b38_1.conda filter=lfs diff=lfs merge=lfs -text
1910
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/python-dateutil-2.9.0.post0-pyhe01879c_2.conda filter=lfs diff=lfs merge=lfs -text
1911
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/setuptools-82.0.1-pyh332efcf_0.conda filter=lfs diff=lfs merge=lfs -text
1912
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda filter=lfs diff=lfs merge=lfs -text
1913
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/urllib3-2.7.0-pyhd8ed1ab_0.conda filter=lfs diff=lfs merge=lfs -text
1914
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py314h58356db_1.conda filter=lfs diff=lfs merge=lfs -text
1915
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py314he701e3d_1.conda filter=lfs diff=lfs merge=lfs -text
1916
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/cppcheck-2.20.1-py314h7ae7f31_0.conda filter=lfs diff=lfs merge=lfs -text
1917
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/doxygen-1.13.2-hbf3f430_0.conda filter=lfs diff=lfs merge=lfs -text
1918
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/libiconv-1.18-hc1393d2_2.conda filter=lfs diff=lfs merge=lfs -text
1919
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_0.conda filter=lfs diff=lfs merge=lfs -text
1920
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.1-hf5d6505_0.conda filter=lfs diff=lfs merge=lfs -text
1921
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mkl-2023.1.0-h6a75c08_48682.conda filter=lfs diff=lfs merge=lfs -text
1922
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0.conda filter=lfs diff=lfs merge=lfs -text
1923
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0.conda filter=lfs diff=lfs merge=lfs -text
1924
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0.conda filter=lfs diff=lfs merge=lfs -text
1925
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314h8f04a7f_0.conda filter=lfs diff=lfs merge=lfs -text
1926
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/psutil-7.2.2-py314hc5dbbe4_0.conda filter=lfs diff=lfs merge=lfs -text
1927
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython.conda filter=lfs diff=lfs merge=lfs -text
1928
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314.conda filter=lfs diff=lfs merge=lfs -text
1929
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t.conda filter=lfs diff=lfs merge=lfs -text
1930
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-librt-0.11.0-py314h8f04a7f_0.conda filter=lfs diff=lfs merge=lfs -text
1931
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-librt-0.11.0-py314hc5dbbe4_0.conda filter=lfs diff=lfs merge=lfs -text
1932
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pytokens-0.4.1-py314h8f04a7f_1.conda filter=lfs diff=lfs merge=lfs -text
1933
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/ruff-0.15.12-hd7ccaa8_0.conda filter=lfs diff=lfs merge=lfs -text
1934
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3.conda filter=lfs diff=lfs merge=lfs -text
1935
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0.conda filter=lfs diff=lfs merge=lfs -text
1936
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35.conda filter=lfs diff=lfs merge=lfs -text
1937
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vcomp14-14.44.35208-h818238b_35.conda filter=lfs diff=lfs merge=lfs -text
1938
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/watchdog-6.0.0-py314hb821551_3.conda filter=lfs diff=lfs merge=lfs -text
1939
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/watchdog-6.0.0-py314he37c773_3.conda filter=lfs diff=lfs merge=lfs -text
1940
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6.conda filter=lfs diff=lfs merge=lfs -text
1941
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/python.pdb filter=lfs diff=lfs merge=lfs -text
1942
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/python311.dll filter=lfs diff=lfs merge=lfs -text
1943
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/python311.pdb filter=lfs diff=lfs merge=lfs -text
1944
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/pythonw.pdb filter=lfs diff=lfs merge=lfs -text
1945
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/python.pdb filter=lfs diff=lfs merge=lfs -text
1946
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/python314.dll filter=lfs diff=lfs merge=lfs -text
1947
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/python314.pdb filter=lfs diff=lfs merge=lfs -text
1948
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/pythonw.pdb filter=lfs diff=lfs merge=lfs -text
1949
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/python314t.dll filter=lfs diff=lfs merge=lfs -text
1950
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/python314t.pdb filter=lfs diff=lfs merge=lfs -text
1951
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0/ucrtbase.dll filter=lfs diff=lfs merge=lfs -text
1952
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/concrt140.dll filter=lfs diff=lfs merge=lfs -text
1953
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/msvcp140.dll filter=lfs diff=lfs merge=lfs -text
1954
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/msvcp140_2.dll filter=lfs diff=lfs merge=lfs -text
1955
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/vcamp140.dll filter=lfs diff=lfs merge=lfs -text
1956
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/vccorlib140.dll filter=lfs diff=lfs merge=lfs -text
1957
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/vcruntime140.dll filter=lfs diff=lfs merge=lfs -text
1958
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vcomp14-14.44.35208-h818238b_35/vcomp140.dll filter=lfs diff=lfs merge=lfs -text
1959
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6/Library/bin/libzstd.dll filter=lfs diff=lfs merge=lfs -text
1960
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6/Library/bin/zstd.dll filter=lfs diff=lfs merge=lfs -text
1961
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/zstd-1.5.7-h534d264_6/Library/bin/zstd.exe filter=lfs diff=lfs merge=lfs -text
1962
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/yaml-0.2.5-h6a83c73_3/Library/bin/yaml.dll filter=lfs diff=lfs merge=lfs -text
1963
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vcomp14-14.44.35208-h818238b_35/Library/bin/vcomp140.dll filter=lfs diff=lfs merge=lfs -text
1964
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/Library/bin/concrt140.dll filter=lfs diff=lfs merge=lfs -text
1965
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/Library/bin/msvcp140.dll filter=lfs diff=lfs merge=lfs -text
1966
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/Library/bin/msvcp140_2.dll filter=lfs diff=lfs merge=lfs -text
1967
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/Library/bin/vcamp140.dll filter=lfs diff=lfs merge=lfs -text
1968
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/Library/bin/vccorlib140.dll filter=lfs diff=lfs merge=lfs -text
1969
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/vc14_runtime-14.44.35208-h818238b_35/Library/bin/vcruntime140.dll filter=lfs diff=lfs merge=lfs -text
1970
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/ucrt-10.0.26100.0-h57928b3_0/Library/bin/ucrtbase.dll filter=lfs diff=lfs merge=lfs -text
1971
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/bin/tcl86t.dll filter=lfs diff=lfs merge=lfs -text
1972
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/bin/tk86t.dll filter=lfs diff=lfs merge=lfs -text
1973
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/bin/zlib1.dll filter=lfs diff=lfs merge=lfs -text
1974
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/lib/tcl86t.lib filter=lfs diff=lfs merge=lfs -text
1975
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/lib/tk86t.lib filter=lfs diff=lfs merge=lfs -text
1976
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/lib/itcl4.2.3/itcl423t.dll filter=lfs diff=lfs merge=lfs -text
1977
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/lib/sqlite3.40.0/sqlite3400t.dll filter=lfs diff=lfs merge=lfs -text
1978
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/lib/thread2.8.8/thread288t.dll filter=lfs diff=lfs merge=lfs -text
1979
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tk-8.6.13-h6ed50ae_3/Library/lib/tk8.6/demos/images/teapot.ppm filter=lfs diff=lfs merge=lfs -text
1980
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/tinyxml2-11.0.0-he0c23c2_0/Library/lib/tinyxml2.lib filter=lfs diff=lfs merge=lfs -text
1981
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/ruff-0.15.12-hd7ccaa8_0/python-scripts/ruff.exe filter=lfs diff=lfs merge=lfs -text
1982
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pytokens-0.4.1-py314h8f04a7f_1/Lib/site-packages/fd7dcdb10166ebd4db98__mypyc.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1983
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-librt-0.11.0-py314hc5dbbe4_0/Lib/site-packages/librt/vecs.cp314-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1984
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-librt-0.11.0-py314h8f04a7f_0/Lib/site-packages/librt/vecs.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1985
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/unicodedata.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1986
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/_ctypes.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1987
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/_ctypes_test.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1988
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/_decimal.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1989
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/_sqlite3.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1990
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/_ssl.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1991
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/_testcapi.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1992
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/_testlimitedcapi.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
1993
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/libs/python314t.lib filter=lfs diff=lfs merge=lfs -text
1994
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/libs/python3t.lib filter=lfs diff=lfs merge=lfs -text
1995
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/argparse.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
1996
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/doctest.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
1997
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/inspect.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
1998
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/mailbox.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
1999
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pdb.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2000
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/pydoc.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2001
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/tarfile.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2002
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/turtle.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2003
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/typing.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2004
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_pydatetime.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2005
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_pydecimal.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2006
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/__pycache__/_pyio.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2007
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/zipfile/__pycache__/__init__.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2008
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/python.exe filter=lfs diff=lfs merge=lfs -text
2009
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/pythonw.exe filter=lfs diff=lfs merge=lfs -text
2010
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/venvlaunchert.exe filter=lfs diff=lfs merge=lfs -text
2011
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/venv/scripts/nt/venvwlaunchert.exe filter=lfs diff=lfs merge=lfs -text
2012
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/unittest/__pycache__/mock.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2013
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/tkinter/__pycache__/__init__.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2014
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/test/support/__pycache__/__init__.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2015
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/pydoc_data/__pycache__/topics.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2016
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/idlelib/__pycache__/configdialog.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2017
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/ensurepip/_bundled/pip-26.0.1-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
2018
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/Lib/email/__pycache__/_header_value_parser.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2019
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/unicodedata.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2020
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_asyncio.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2021
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_ctypes.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2022
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_ctypes_test.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2023
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_decimal.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2024
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_socket.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2025
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_sqlite3.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2026
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_ssl.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2027
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_testcapi.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2028
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h7c1dbca_0_cp314t/DLLs/instrumented/_testlimitedcapi.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2029
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/unicodedata.pyd filter=lfs diff=lfs merge=lfs -text
2030
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/_ctypes.pyd filter=lfs diff=lfs merge=lfs -text
2031
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/_ctypes_test.pyd filter=lfs diff=lfs merge=lfs -text
2032
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/_decimal.pyd filter=lfs diff=lfs merge=lfs -text
2033
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/_sqlite3.pyd filter=lfs diff=lfs merge=lfs -text
2034
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/_ssl.pyd filter=lfs diff=lfs merge=lfs -text
2035
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/_testcapi.pyd filter=lfs diff=lfs merge=lfs -text
2036
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/_testlimitedcapi.pyd filter=lfs diff=lfs merge=lfs -text
2037
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/libs/python3.lib filter=lfs diff=lfs merge=lfs -text
2038
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/libs/python314.lib filter=lfs diff=lfs merge=lfs -text
2039
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/argparse.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2040
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/doctest.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2041
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/inspect.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2042
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/mailbox.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2043
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/pdb.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2044
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/pydoc.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2045
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/tarfile.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2046
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/turtle.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2047
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/typing.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2048
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/_pydatetime.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2049
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/_pydecimal.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2050
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/__pycache__/_pyio.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2051
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/zipfile/__pycache__/__init__.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2052
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/venv/scripts/nt/python.exe filter=lfs diff=lfs merge=lfs -text
2053
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/venv/scripts/nt/pythonw.exe filter=lfs diff=lfs merge=lfs -text
2054
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/venv/scripts/nt/venvlauncher.exe filter=lfs diff=lfs merge=lfs -text
2055
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/venv/scripts/nt/venvwlauncher.exe filter=lfs diff=lfs merge=lfs -text
2056
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/unittest/__pycache__/mock.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2057
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/tkinter/__pycache__/__init__.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2058
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/test/support/__pycache__/__init__.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2059
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/pydoc_data/__pycache__/topics.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2060
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/idlelib/__pycache__/configdialog.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2061
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/ensurepip/_bundled/pip-26.0.1-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
2062
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/Lib/email/__pycache__/_header_value_parser.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2063
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/unicodedata.pyd filter=lfs diff=lfs merge=lfs -text
2064
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/_ctypes.pyd filter=lfs diff=lfs merge=lfs -text
2065
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/_ctypes_test.pyd filter=lfs diff=lfs merge=lfs -text
2066
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/_decimal.pyd filter=lfs diff=lfs merge=lfs -text
2067
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/_sqlite3.pyd filter=lfs diff=lfs merge=lfs -text
2068
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/_ssl.pyd filter=lfs diff=lfs merge=lfs -text
2069
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/_testcapi.pyd filter=lfs diff=lfs merge=lfs -text
2070
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.14.4-h4b44e0e_100_cp314/DLLs/instrumented/_testlimitedcapi.pyd filter=lfs diff=lfs merge=lfs -text
2071
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/DLLs/unicodedata.pyd filter=lfs diff=lfs merge=lfs -text
2072
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/DLLs/_ctypes.pyd filter=lfs diff=lfs merge=lfs -text
2073
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/DLLs/_decimal.pyd filter=lfs diff=lfs merge=lfs -text
2074
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/DLLs/_ssl.pyd filter=lfs diff=lfs merge=lfs -text
2075
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/DLLs/_testcapi.pyd filter=lfs diff=lfs merge=lfs -text
2076
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/libs/python3.lib filter=lfs diff=lfs merge=lfs -text
2077
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/libs/python311.lib filter=lfs diff=lfs merge=lfs -text
2078
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Tools/scripts/__pycache__/texi2html.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2079
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/argparse.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2080
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/ast.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2081
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/datetime.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2082
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/doctest.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2083
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/inspect.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2084
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/mailbox.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2085
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/pydoc.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2086
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/tarfile.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2087
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/turtle.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2088
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/typing.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2089
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/zipfile.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2090
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/_pydecimal.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2091
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/__pycache__/_pyio.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2092
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/venv/scripts/nt/python.exe filter=lfs diff=lfs merge=lfs -text
2093
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/venv/scripts/nt/pythonw.exe filter=lfs diff=lfs merge=lfs -text
2094
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/urllib/__pycache__/request.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2095
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/unittest/__pycache__/mock.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2096
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/unittest/test/__pycache__/test_case.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2097
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/unittest/test/__pycache__/test_loader.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2098
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/unittest/test/__pycache__/test_result.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2099
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/unittest/test/__pycache__/test_runner.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2100
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/unittest/test/testmock/__pycache__/testmock.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2101
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/unittest/test/testmock/__pycache__/testpatch.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2102
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/tkinter/__pycache__/tix.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2103
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/tkinter/__pycache__/__init__.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2104
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/tkinter/test/test_ttk/__pycache__/test_widgets.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2105
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/tkinter/test/test_tkinter/__pycache__/test_widgets.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2106
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/test/support/__pycache__/__init__.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2107
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/pydoc_data/__pycache__/topics.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2108
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/idlelib/__pycache__/configdialog.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2109
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/_bundled/pip-24.0-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
2110
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/ensurepip/_bundled/setuptools-79.0.1-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text
2111
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/python-3.11.15-h0159041_0_cpython/Lib/email/__pycache__/_header_value_parser.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
2112
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcre.dll filter=lfs diff=lfs merge=lfs -text
2113
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/pcre-8.45-h0e60522_0/Library/bin/pcrecpp_unittest.exe filter=lfs diff=lfs merge=lfs -text
2114
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/libcrypto-3-x64.dll filter=lfs diff=lfs merge=lfs -text
2115
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/libcrypto-3-x64.pdb filter=lfs diff=lfs merge=lfs -text
2116
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/libssl-3-x64.dll filter=lfs diff=lfs merge=lfs -text
2117
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/libssl-3-x64.pdb filter=lfs diff=lfs merge=lfs -text
2118
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/openssl.exe filter=lfs diff=lfs merge=lfs -text
2119
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/bin/openssl.pdb filter=lfs diff=lfs merge=lfs -text
2120
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/libcrypto.lib filter=lfs diff=lfs merge=lfs -text
2121
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/openssl-3.6.2-hf411b9b_0/Library/lib/libssl.lib filter=lfs diff=lfs merge=lfs -text
2122
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/0aca9ce3d91742c5b361__mypyc.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2123
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypyc/irbuild/__pycache__/builder.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2124
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypyc/irbuild/__pycache__/ll_builder.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2125
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypyc/ir/__pycache__/ops.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2126
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/build.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2127
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/checker.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2128
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/checkexpr.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2129
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/fastparse.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2130
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/messages.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2131
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/nodes.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2132
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/semanal.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2133
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/stubgen.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2134
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/stubtest.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2135
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/subtypes.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2136
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/typeanal.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2137
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/__pycache__/types.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2138
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/test/__pycache__/teststubgen.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2139
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/test/__pycache__/teststubtest.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2140
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314hac7e1cd_0/Lib/site-packages/mypy/test/__pycache__/testtypes.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2141
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/0aca9ce3d91742c5b361__mypyc.cp314-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2142
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypyc/irbuild/__pycache__/builder.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2143
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypyc/irbuild/__pycache__/ll_builder.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2144
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypyc/ir/__pycache__/ops.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2145
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/build.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2146
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/checker.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2147
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/checkexpr.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2148
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/fastparse.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2149
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/messages.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2150
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/nodes.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2151
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/semanal.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2152
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/stubgen.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2153
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/stubtest.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2154
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/subtypes.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2155
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/typeanal.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2156
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/__pycache__/types.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2157
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/test/__pycache__/teststubgen.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2158
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/test/__pycache__/teststubtest.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2159
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/mypy-1.20.2-py314h5a2d7ad_0/Lib/site-packages/mypy/test/__pycache__/testtypes.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2160
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/libsqlite-3.53.1-hf5d6505_0/Library/bin/sqlite3.dll filter=lfs diff=lfs merge=lfs -text
2161
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/libmpdec-4.0.0-hfd05255_1/Library/bin/libmpdec-4.dll filter=lfs diff=lfs merge=lfs -text
2162
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/liblzma-5.8.3-hfd05255_0/Library/bin/liblzma.dll filter=lfs diff=lfs merge=lfs -text
2163
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/libiconv-1.18-hc1393d2_2/Library/bin/iconv.dll filter=lfs diff=lfs merge=lfs -text
2164
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/libexpat-2.8.0-hac47afa_0/Library/bin/libexpat.dll filter=lfs diff=lfs merge=lfs -text
2165
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/doxygen-1.13.2-hbf3f430_0/Library/bin/doxyapp.exe filter=lfs diff=lfs merge=lfs -text
2166
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/doxygen-1.13.2-hbf3f430_0/Library/bin/doxygen.exe filter=lfs diff=lfs merge=lfs -text
2167
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/cppcheck-2.20.1-py314h7ae7f31_0/Scripts/cppcheck-htmlreport.exe filter=lfs diff=lfs merge=lfs -text
2168
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/cppcheck-2.20.1-py314h7ae7f31_0/share/Cppcheck/addons/__pycache__/misra.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
2169
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/cppcheck-2.20.1-py314h7ae7f31_0/Library/bin/cppcheck.exe filter=lfs diff=lfs merge=lfs -text
2170
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_9/Library/lib/bzip2_static.lib filter=lfs diff=lfs merge=lfs -text
2171
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_9/Library/lib/libbz2_static.lib filter=lfs diff=lfs merge=lfs -text
2172
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py314he701e3d_1/Lib/site-packages/_brotli.cp314-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2173
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/win-64/brotli-python-1.2.0-py314h58356db_1/Lib/site-packages/_brotli.cp314t-win_amd64.pyd filter=lfs diff=lfs merge=lfs -text
2174
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pip-26.1.1-pyh8b19718_0/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text
2175
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pip-26.1.1-pyh8b19718_0/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text
2176
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pip-26.1.1-pyh8b19718_0/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text
2177
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/pip-26.1.1-pyh8b19718_0/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text
2178
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/fontawesome-webfont.eot filter=lfs diff=lfs merge=lfs -text
2179
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/fontawesome-webfont.ttf filter=lfs diff=lfs merge=lfs -text
2180
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-bold-italic.woff filter=lfs diff=lfs merge=lfs -text
2181
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-bold-italic.woff2 filter=lfs diff=lfs merge=lfs -text
2182
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-bold.woff filter=lfs diff=lfs merge=lfs -text
2183
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-bold.woff2 filter=lfs diff=lfs merge=lfs -text
2184
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-normal-italic.woff filter=lfs diff=lfs merge=lfs -text
2185
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-normal-italic.woff2 filter=lfs diff=lfs merge=lfs -text
2186
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-normal.woff filter=lfs diff=lfs merge=lfs -text
2187
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/readthedocs/css/fonts/lato-normal.woff2 filter=lfs diff=lfs merge=lfs -text
2188
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/mkdocs/webfonts/fa-brands-400.ttf filter=lfs diff=lfs merge=lfs -text
2189
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/mkdocs/webfonts/fa-brands-400.woff2 filter=lfs diff=lfs merge=lfs -text
2190
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/mkdocs/webfonts/fa-solid-900.ttf filter=lfs diff=lfs merge=lfs -text
2191
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/mkdocs-1.6.1-pyhd8ed1ab_1/site-packages/mkdocs/themes/mkdocs/webfonts/fa-solid-900.woff2 filter=lfs diff=lfs merge=lfs -text
2192
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-msys2-runtime-3.6.1.4-hc364b38_6/Library/usr/bin/cygcheck.exe filter=lfs diff=lfs merge=lfs -text
2193
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-msys2-runtime-3.6.1.4-hc364b38_6/Library/usr/bin/dumper.exe filter=lfs diff=lfs merge=lfs -text
2194
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-msys2-runtime-3.6.1.4-hc364b38_6/Library/usr/bin/msys-2.0.dll filter=lfs diff=lfs merge=lfs -text
2195
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-make-4.4.1.2-hc364b38_6/Library/usr/bin/make.exe filter=lfs diff=lfs merge=lfs -text
2196
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-libintl-0.22.5.1-hc364b38_6/Library/usr/bin/msys-intl-8.dll filter=lfs diff=lfs merge=lfs -text
2197
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-libiconv-1.18.1-hc364b38_6/Library/usr/bin/msys-iconv-2.dll filter=lfs diff=lfs merge=lfs -text
2198
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-gcc-libs-13.3.0.1-hc364b38_6/Library/usr/bin/msys-gcc_s-seh-1.dll filter=lfs diff=lfs merge=lfs -text
2199
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-gcc-libs-13.3.0.1-hc364b38_6/Library/usr/bin/msys-gomp-1.dll filter=lfs diff=lfs merge=lfs -text
2200
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-gcc-libs-13.3.0.1-hc364b38_6/Library/usr/bin/msys-quadmath-0.dll filter=lfs diff=lfs merge=lfs -text
2201
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-gcc-libs-13.3.0.1-hc364b38_6/Library/usr/bin/msys-stdc++-6.dll filter=lfs diff=lfs merge=lfs -text
2202
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/bin/bash.exe filter=lfs diff=lfs merge=lfs -text
2203
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/bin/sh.exe filter=lfs diff=lfs merge=lfs -text
2204
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/zh_TW/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2205
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/zh_CN/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2206
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/vi/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2207
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/uk/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2208
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/tr/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2209
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/sv/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2210
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/sr/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2211
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/ru/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2212
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/ro/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2213
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/pt_BR/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2214
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/pt/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2215
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/pl/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2216
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/nl/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2217
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/nb/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2218
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/ko/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2219
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/ja/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2220
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/hu/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2221
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/hr/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2222
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/ga/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2223
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/fr/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2224
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/es/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2225
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/eo/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2226
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/en@quot/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2227
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/en@boldquot/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2228
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/de/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2229
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/cs/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2230
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/ca/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2231
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/m2-bash-5.2.037.2-hc364b38_6/Library/usr/share/locale/bg/LC_MESSAGES/bash.mo filter=lfs diff=lfs merge=lfs -text
2232
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/global.dat filter=lfs diff=lfs merge=lfs -text
2233
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/af.dat filter=lfs diff=lfs merge=lfs -text
2234
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ak.dat filter=lfs diff=lfs merge=lfs -text
2235
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/am.dat filter=lfs diff=lfs merge=lfs -text
2236
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ar.dat filter=lfs diff=lfs merge=lfs -text
2237
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/as.dat filter=lfs diff=lfs merge=lfs -text
2238
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ast.dat filter=lfs diff=lfs merge=lfs -text
2239
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/az.dat filter=lfs diff=lfs merge=lfs -text
2240
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bal_Latn.dat filter=lfs diff=lfs merge=lfs -text
2241
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/be.dat filter=lfs diff=lfs merge=lfs -text
2242
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bew.dat filter=lfs diff=lfs merge=lfs -text
2243
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/be_TARASK.dat filter=lfs diff=lfs merge=lfs -text
2244
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bg.dat filter=lfs diff=lfs merge=lfs -text
2245
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/blo.dat filter=lfs diff=lfs merge=lfs -text
2246
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bn.dat filter=lfs diff=lfs merge=lfs -text
2247
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/br.dat filter=lfs diff=lfs merge=lfs -text
2248
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/brx.dat filter=lfs diff=lfs merge=lfs -text
2249
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bs.dat filter=lfs diff=lfs merge=lfs -text
2250
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bs_Cyrl.dat filter=lfs diff=lfs merge=lfs -text
2251
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ca.dat filter=lfs diff=lfs merge=lfs -text
2252
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ccp.dat filter=lfs diff=lfs merge=lfs -text
2253
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ce.dat filter=lfs diff=lfs merge=lfs -text
2254
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ceb.dat filter=lfs diff=lfs merge=lfs -text
2255
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/chr.dat filter=lfs diff=lfs merge=lfs -text
2256
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cs.dat filter=lfs diff=lfs merge=lfs -text
2257
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cv.dat filter=lfs diff=lfs merge=lfs -text
2258
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cy.dat filter=lfs diff=lfs merge=lfs -text
2259
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/da.dat filter=lfs diff=lfs merge=lfs -text
2260
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/de.dat filter=lfs diff=lfs merge=lfs -text
2261
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/dsb.dat filter=lfs diff=lfs merge=lfs -text
2262
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/el.dat filter=lfs diff=lfs merge=lfs -text
2263
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/en.dat filter=lfs diff=lfs merge=lfs -text
2264
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/eo.dat filter=lfs diff=lfs merge=lfs -text
2265
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/es.dat filter=lfs diff=lfs merge=lfs -text
2266
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/et.dat filter=lfs diff=lfs merge=lfs -text
2267
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/eu.dat filter=lfs diff=lfs merge=lfs -text
2268
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/fa.dat filter=lfs diff=lfs merge=lfs -text
2269
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ff_Adlm.dat filter=lfs diff=lfs merge=lfs -text
2270
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/fi.dat filter=lfs diff=lfs merge=lfs -text
2271
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/fil.dat filter=lfs diff=lfs merge=lfs -text
2272
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/fo.dat filter=lfs diff=lfs merge=lfs -text
2273
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/fr.dat filter=lfs diff=lfs merge=lfs -text
2274
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/frr.dat filter=lfs diff=lfs merge=lfs -text
2275
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/fy.dat filter=lfs diff=lfs merge=lfs -text
2276
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ga.dat filter=lfs diff=lfs merge=lfs -text
2277
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/gd.dat filter=lfs diff=lfs merge=lfs -text
2278
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/gl.dat filter=lfs diff=lfs merge=lfs -text
2279
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/gu.dat filter=lfs diff=lfs merge=lfs -text
2280
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ha.dat filter=lfs diff=lfs merge=lfs -text
2281
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/he.dat filter=lfs diff=lfs merge=lfs -text
2282
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/hi.dat filter=lfs diff=lfs merge=lfs -text
2283
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/hr.dat filter=lfs diff=lfs merge=lfs -text
2284
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/hsb.dat filter=lfs diff=lfs merge=lfs -text
2285
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/hu.dat filter=lfs diff=lfs merge=lfs -text
2286
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/hy.dat filter=lfs diff=lfs merge=lfs -text
2287
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ia.dat filter=lfs diff=lfs merge=lfs -text
2288
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/id.dat filter=lfs diff=lfs merge=lfs -text
2289
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/is.dat filter=lfs diff=lfs merge=lfs -text
2290
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/it.dat filter=lfs diff=lfs merge=lfs -text
2291
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ja.dat filter=lfs diff=lfs merge=lfs -text
2292
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/jv.dat filter=lfs diff=lfs merge=lfs -text
2293
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ka.dat filter=lfs diff=lfs merge=lfs -text
2294
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/kab.dat filter=lfs diff=lfs merge=lfs -text
2295
+ micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/kgp.dat filter=lfs diff=lfs merge=lfs -text
git/usr/share/perl5/core_perl/IO/Compress/Zip.pm ADDED
@@ -0,0 +1,2291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package IO::Compress::Zip ;
2
+
3
+ use strict ;
4
+ use warnings;
5
+ use bytes;
6
+
7
+ use IO::Compress::Base::Common 2.213 qw(:Status );
8
+ use IO::Compress::RawDeflate 2.213 ();
9
+ use IO::Compress::Adapter::Deflate 2.213 ;
10
+ use IO::Compress::Adapter::Identity 2.213 ;
11
+ use IO::Compress::Zlib::Extra 2.213 ;
12
+ use IO::Compress::Zip::Constants 2.213 ;
13
+
14
+ use File::Spec();
15
+ use Config;
16
+
17
+ use Compress::Raw::Zlib 2.213 ();
18
+
19
+ BEGIN
20
+ {
21
+ eval { require IO::Compress::Adapter::Bzip2 ;
22
+ IO::Compress::Adapter::Bzip2->VERSION( 2.213 );
23
+ require IO::Compress::Bzip2 ;
24
+ IO::Compress::Bzip2->VERSION( 2.213 );
25
+ } ;
26
+
27
+ eval { require IO::Compress::Adapter::Lzma ;
28
+ IO::Compress::Adapter::Lzma->VERSION( 2.213 );
29
+ require IO::Compress::Lzma ;
30
+ IO::Compress::Lzma->VERSION( 2.213 );
31
+ } ;
32
+
33
+ eval { require IO::Compress::Adapter::Xz ;
34
+ IO::Compress::Adapter::Xz->VERSION( 2.213 );
35
+ require IO::Compress::Xz ;
36
+ IO::Compress::Xz->VERSION( 2.213 );
37
+ } ;
38
+ eval { require IO::Compress::Adapter::Zstd ;
39
+ IO::Compress::Adapter::Zstd->VERSION( 2.213 );
40
+ require IO::Compress::Zstd ;
41
+ IO::Compress::Zstd->VERSION( 2.213 );
42
+ } ;
43
+ }
44
+
45
+
46
+ require Exporter ;
47
+
48
+ our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $ZipError);
49
+
50
+ $VERSION = '2.213';
51
+ $ZipError = '';
52
+
53
+ @ISA = qw(IO::Compress::RawDeflate Exporter);
54
+ @EXPORT_OK = qw( $ZipError zip ) ;
55
+ %EXPORT_TAGS = %IO::Compress::RawDeflate::DEFLATE_CONSTANTS ;
56
+
57
+ push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
58
+
59
+ $EXPORT_TAGS{zip_method} = [qw( ZIP_CM_STORE ZIP_CM_DEFLATE ZIP_CM_BZIP2 ZIP_CM_LZMA ZIP_CM_XZ ZIP_CM_ZSTD)];
60
+ push @{ $EXPORT_TAGS{all} }, @{ $EXPORT_TAGS{zip_method} };
61
+
62
+ Exporter::export_ok_tags('all');
63
+
64
+ sub new
65
+ {
66
+ my $class = shift ;
67
+
68
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$ZipError);
69
+ $obj->_create(undef, @_);
70
+
71
+ }
72
+
73
+ sub zip
74
+ {
75
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$ZipError);
76
+ return $obj->_def(@_);
77
+ }
78
+
79
+ sub isMethodAvailable
80
+ {
81
+ my $method = shift;
82
+
83
+ # Store & Deflate are always available
84
+ return 1
85
+ if $method == ZIP_CM_STORE || $method == ZIP_CM_DEFLATE ;
86
+
87
+ return 1
88
+ if $method == ZIP_CM_BZIP2 &&
89
+ defined $IO::Compress::Adapter::Bzip2::VERSION &&
90
+ defined &{ "IO::Compress::Adapter::Bzip2::mkRawZipCompObject" };
91
+
92
+ return 1
93
+ if $method == ZIP_CM_LZMA &&
94
+ defined $IO::Compress::Adapter::Lzma::VERSION &&
95
+ defined &{ "IO::Compress::Adapter::Lzma::mkRawZipCompObject" };
96
+
97
+ return 1
98
+ if $method == ZIP_CM_XZ &&
99
+ defined $IO::Compress::Adapter::Xz::VERSION &&
100
+ defined &{ "IO::Compress::Adapter::Xz::mkRawZipCompObject" };
101
+
102
+ return 1
103
+ if $method == ZIP_CM_ZSTD &&
104
+ defined $IO::Compress::Adapter::ZSTD::VERSION &&
105
+ defined &{ "IO::Compress::Adapter::ZSTD::mkRawZipCompObject" };
106
+
107
+ return 0;
108
+ }
109
+
110
+ sub beforePayload
111
+ {
112
+ my $self = shift ;
113
+
114
+ if (*$self->{ZipData}{Sparse} ) {
115
+ my $inc = 1024 * 100 ;
116
+ my $NULLS = ("\x00" x $inc) ;
117
+ my $sparse = *$self->{ZipData}{Sparse} ;
118
+ *$self->{CompSize}->add( $sparse );
119
+ *$self->{UnCompSize}->add( $sparse );
120
+
121
+ *$self->{FH}->seek($sparse, IO::Handle::SEEK_CUR);
122
+
123
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32($NULLS, *$self->{ZipData}{CRC32})
124
+ for 1 .. int $sparse / $inc;
125
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(substr($NULLS, 0, $sparse % $inc),
126
+ *$self->{ZipData}{CRC32})
127
+ if $sparse % $inc;
128
+ }
129
+ }
130
+
131
+ sub mkComp
132
+ {
133
+ my $self = shift ;
134
+ my $got = shift ;
135
+
136
+ my ($obj, $errstr, $errno) ;
137
+
138
+ if (*$self->{ZipData}{Method} == ZIP_CM_STORE) {
139
+ ($obj, $errstr, $errno) = IO::Compress::Adapter::Identity::mkCompObject(
140
+ $got->getValue('level'),
141
+ $got->getValue('strategy')
142
+ );
143
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(undef);
144
+ }
145
+ elsif (*$self->{ZipData}{Method} == ZIP_CM_DEFLATE) {
146
+ ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject(
147
+ $got->getValue('crc32'),
148
+ $got->getValue('adler32'),
149
+ $got->getValue('level'),
150
+ $got->getValue('strategy')
151
+ );
152
+ }
153
+ elsif (*$self->{ZipData}{Method} == ZIP_CM_BZIP2) {
154
+ ($obj, $errstr, $errno) = IO::Compress::Adapter::Bzip2::mkCompObject(
155
+ $got->getValue('blocksize100k'),
156
+ $got->getValue('workfactor'),
157
+ $got->getValue('verbosity')
158
+ );
159
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(undef);
160
+ }
161
+ elsif (*$self->{ZipData}{Method} == ZIP_CM_LZMA) {
162
+ ($obj, $errstr, $errno) = IO::Compress::Adapter::Lzma::mkRawZipCompObject($got->getValue('preset'),
163
+ $got->getValue('extreme'),
164
+ );
165
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(undef);
166
+ }
167
+ elsif (*$self->{ZipData}{Method} == ZIP_CM_XZ) {
168
+ ($obj, $errstr, $errno) = IO::Compress::Adapter::Xz::mkCompObject($got->getValue('preset'),
169
+ $got->getValue('extreme'),
170
+ 0
171
+ );
172
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(undef);
173
+ }
174
+ elsif (*$self->{ZipData}{Method} == ZIP_CM_ZSTD) {
175
+ ($obj, $errstr, $errno) = IO::Compress::Adapter::Zstd::mkCompObject(defined $got->getValue('level') ? $got->getValue('level') : 3,
176
+ );
177
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(undef);
178
+ }
179
+
180
+ return $self->saveErrorString(undef, $errstr, $errno)
181
+ if ! defined $obj;
182
+
183
+ if (! defined *$self->{ZipData}{SizesOffset}) {
184
+ *$self->{ZipData}{SizesOffset} = 0;
185
+ *$self->{ZipData}{Offset} = U64->new();
186
+ }
187
+
188
+ *$self->{ZipData}{AnyZip64} = 0
189
+ if ! defined *$self->{ZipData}{AnyZip64} ;
190
+
191
+ return $obj;
192
+ }
193
+
194
+ sub reset
195
+ {
196
+ my $self = shift ;
197
+
198
+ *$self->{Compress}->reset();
199
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32('');
200
+
201
+ return STATUS_OK;
202
+ }
203
+
204
+ sub filterUncompressed
205
+ {
206
+ my $self = shift ;
207
+
208
+ if (*$self->{ZipData}{Method} == ZIP_CM_DEFLATE) {
209
+ *$self->{ZipData}{CRC32} = *$self->{Compress}->crc32();
210
+ }
211
+ else {
212
+ *$self->{ZipData}{CRC32} = Compress::Raw::Zlib::crc32(${$_[0]}, *$self->{ZipData}{CRC32});
213
+
214
+ }
215
+ }
216
+
217
+ sub canonicalName
218
+ {
219
+ # This sub is derived from Archive::Zip::_asZipDirName
220
+
221
+ # Return the normalized name as used in a zip file (path
222
+ # separators become slashes, etc.).
223
+ # Will translate internal slashes in path components (i.e. on Macs) to
224
+ # underscores. Discards volume names.
225
+ # When $forceDir is set, returns paths with trailing slashes
226
+ #
227
+ # input output
228
+ # . '.'
229
+ # ./a a
230
+ # ./a/b a/b
231
+ # ./a/b/ a/b
232
+ # a/b/ a/b
233
+ # /a/b/ a/b
234
+ # c:\a\b\c.doc a/b/c.doc # on Windows
235
+ # "i/o maps:whatever" i_o maps/whatever # on Macs
236
+
237
+ my $name = shift;
238
+ my $forceDir = shift ;
239
+
240
+ my ( $volume, $directories, $file ) =
241
+ File::Spec->splitpath( File::Spec->canonpath($name), $forceDir );
242
+
243
+ my @dirs = map { $_ =~ s{/}{_}g; $_ }
244
+ File::Spec->splitdir($directories);
245
+
246
+ if ( @dirs > 0 ) { pop (@dirs) if $dirs[-1] eq '' } # remove empty component
247
+ push @dirs, defined($file) ? $file : '' ;
248
+
249
+ my $normalised_path = join '/', @dirs;
250
+
251
+ # Leading directory separators should not be stored in zip archives.
252
+ # Example:
253
+ # C:\a\b\c\ a/b/c
254
+ # C:\a\b\c.txt a/b/c.txt
255
+ # /a/b/c/ a/b/c
256
+ # /a/b/c.txt a/b/c.txt
257
+ $normalised_path =~ s{^/}{}; # remove leading separator
258
+
259
+ return $normalised_path;
260
+ }
261
+
262
+
263
+ sub mkHeader
264
+ {
265
+ my $self = shift;
266
+ my $param = shift ;
267
+
268
+ *$self->{ZipData}{LocalHdrOffset} = U64::clone(*$self->{ZipData}{Offset});
269
+
270
+ my $comment = '';
271
+ $comment = $param->valueOrDefault('comment') ;
272
+
273
+ my $filename = '';
274
+ $filename = $param->valueOrDefault('name') ;
275
+
276
+ $filename = canonicalName($filename)
277
+ if length $filename && $param->getValue('canonicalname') ;
278
+
279
+ if (defined *$self->{ZipData}{FilterName} ) {
280
+ local *_ = \$filename ;
281
+ &{ *$self->{ZipData}{FilterName} }() ;
282
+ }
283
+
284
+ if ( $param->getValue('efs') && $] >= 5.008004) {
285
+ if (length $filename) {
286
+ utf8::downgrade($filename, 1)
287
+ or Carp::croak "Wide character in zip filename";
288
+ }
289
+
290
+ if (length $comment) {
291
+ utf8::downgrade($comment, 1)
292
+ or Carp::croak "Wide character in zip comment";
293
+ }
294
+ }
295
+
296
+ my $hdr = '';
297
+
298
+ my $time = _unixToDosTime($param->getValue('time'));
299
+
300
+ my $extra = '';
301
+ my $ctlExtra = '';
302
+ my $empty = 0;
303
+ my $osCode = $param->getValue('os_code') ;
304
+ my $extFileAttr = 0 ;
305
+
306
+ # This code assumes Unix.
307
+ # TODO - revisit this
308
+ $extFileAttr = 0100644 << 16
309
+ if $osCode == ZIP_OS_CODE_UNIX ;
310
+
311
+ if (*$self->{ZipData}{Zip64}) {
312
+ $empty = IO::Compress::Base::Common::MAX32;
313
+
314
+ my $x = '';
315
+ $x .= pack "V V", 0, 0 ; # uncompressedLength
316
+ $x .= pack "V V", 0, 0 ; # compressedLength
317
+
318
+ # Zip64 needs to be first in extra field to workaround a Windows Explorer Bug
319
+ # See http://www.info-zip.org/phpBB3/viewtopic.php?f=3&t=440 for details
320
+ $extra .= IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_ZIP64, $x);
321
+ }
322
+
323
+ if (! $param->getValue('minimal')) {
324
+ if ($param->parsed('mtime'))
325
+ {
326
+ $extra .= mkExtendedTime($param->getValue('mtime'),
327
+ $param->getValue('atime'),
328
+ $param->getValue('ctime'));
329
+
330
+ $ctlExtra .= mkExtendedTime($param->getValue('mtime'));
331
+ }
332
+
333
+ if ( $osCode == ZIP_OS_CODE_UNIX )
334
+ {
335
+ if ( $param->getValue('want_exunixn') )
336
+ {
337
+ my $ux3 = mkUnixNExtra( @{ $param->getValue('want_exunixn') });
338
+ $extra .= $ux3;
339
+ $ctlExtra .= $ux3;
340
+ }
341
+
342
+ if ( $param->getValue('exunix2') )
343
+ {
344
+ $extra .= mkUnix2Extra( @{ $param->getValue('exunix2') });
345
+ $ctlExtra .= mkUnix2Extra();
346
+ }
347
+ }
348
+
349
+ $extFileAttr = $param->getValue('extattr')
350
+ if defined $param->getValue('extattr') ;
351
+
352
+ $extra .= $param->getValue('extrafieldlocal')
353
+ if defined $param->getValue('extrafieldlocal');
354
+
355
+ $ctlExtra .= $param->getValue('extrafieldcentral')
356
+ if defined $param->getValue('extrafieldcentral');
357
+ }
358
+
359
+ my $method = *$self->{ZipData}{Method} ;
360
+ my $gpFlag = 0 ;
361
+ $gpFlag |= ZIP_GP_FLAG_STREAMING_MASK
362
+ if *$self->{ZipData}{Stream} ;
363
+
364
+ $gpFlag |= ZIP_GP_FLAG_LZMA_EOS_PRESENT
365
+ if $method == ZIP_CM_LZMA ;
366
+
367
+ $gpFlag |= ZIP_GP_FLAG_LANGUAGE_ENCODING
368
+ if $param->getValue('efs') && (length($filename) || length($comment));
369
+
370
+ my $version = $ZIP_CM_MIN_VERSIONS{$method};
371
+ $version = ZIP64_MIN_VERSION
372
+ if ZIP64_MIN_VERSION > $version && *$self->{ZipData}{Zip64};
373
+
374
+ my $madeBy = ($param->getValue('os_code') << 8) + $version;
375
+ my $extract = $version;
376
+
377
+ *$self->{ZipData}{Version} = $version;
378
+ *$self->{ZipData}{MadeBy} = $madeBy;
379
+
380
+ my $ifa = 0;
381
+ $ifa |= ZIP_IFA_TEXT_MASK
382
+ if $param->getValue('textflag');
383
+
384
+ $hdr .= pack "V", ZIP_LOCAL_HDR_SIG ; # signature
385
+ $hdr .= pack 'v', $extract ; # extract Version & OS
386
+ $hdr .= pack 'v', $gpFlag ; # general purpose flag (set streaming mode)
387
+ $hdr .= pack 'v', $method ; # compression method (deflate)
388
+ $hdr .= pack 'V', $time ; # last mod date/time
389
+ $hdr .= pack 'V', 0 ; # crc32 - 0 when streaming
390
+ $hdr .= pack 'V', $empty ; # compressed length - 0 when streaming
391
+ $hdr .= pack 'V', $empty ; # uncompressed length - 0 when streaming
392
+ $hdr .= pack 'v', length $filename ; # filename length
393
+ $hdr .= pack 'v', length $extra ; # extra length
394
+
395
+ $hdr .= $filename ;
396
+
397
+ # Remember the offset for the compressed & uncompressed lengths in the
398
+ # local header.
399
+ if (*$self->{ZipData}{Zip64}) {
400
+ *$self->{ZipData}{SizesOffset} = *$self->{ZipData}{Offset}->get64bit()
401
+ + length($hdr) + 4 ;
402
+ }
403
+ else {
404
+ *$self->{ZipData}{SizesOffset} = *$self->{ZipData}{Offset}->get64bit()
405
+ + 18;
406
+ }
407
+
408
+ $hdr .= $extra ;
409
+
410
+
411
+ my $ctl = '';
412
+
413
+ $ctl .= pack "V", ZIP_CENTRAL_HDR_SIG ; # signature
414
+ $ctl .= pack 'v', $madeBy ; # version made by
415
+ $ctl .= pack 'v', $extract ; # extract Version
416
+ $ctl .= pack 'v', $gpFlag ; # general purpose flag (streaming mode)
417
+ $ctl .= pack 'v', $method ; # compression method (deflate)
418
+ $ctl .= pack 'V', $time ; # last mod date/time
419
+ $ctl .= pack 'V', 0 ; # crc32
420
+ $ctl .= pack 'V', $empty ; # compressed length
421
+ $ctl .= pack 'V', $empty ; # uncompressed length
422
+ $ctl .= pack 'v', length $filename ; # filename length
423
+
424
+ *$self->{ZipData}{ExtraOffset} = length $ctl;
425
+ *$self->{ZipData}{ExtraSize} = length $ctlExtra ;
426
+
427
+ $ctl .= pack 'v', length $ctlExtra ; # extra length
428
+ $ctl .= pack 'v', length $comment ; # file comment length
429
+ $ctl .= pack 'v', 0 ; # disk number start
430
+ $ctl .= pack 'v', $ifa ; # internal file attributes
431
+ $ctl .= pack 'V', $extFileAttr ; # external file attributes
432
+
433
+ # offset to local hdr
434
+ if (*$self->{ZipData}{LocalHdrOffset}->is64bit() ) {
435
+ $ctl .= pack 'V', IO::Compress::Base::Common::MAX32 ;
436
+ }
437
+ else {
438
+ $ctl .= *$self->{ZipData}{LocalHdrOffset}->getPacked_V32() ;
439
+ }
440
+
441
+ $ctl .= $filename ;
442
+
443
+ *$self->{ZipData}{Offset}->add32(length $hdr) ;
444
+
445
+ *$self->{ZipData}{CentralHeader} = [ $ctl, $ctlExtra, $comment];
446
+
447
+ return $hdr;
448
+ }
449
+
450
+ sub mkTrailer
451
+ {
452
+ my $self = shift ;
453
+
454
+ my $crc32 ;
455
+ if (*$self->{ZipData}{Method} == ZIP_CM_DEFLATE) {
456
+ $crc32 = pack "V", *$self->{Compress}->crc32();
457
+ }
458
+ else {
459
+ $crc32 = pack "V", *$self->{ZipData}{CRC32};
460
+ }
461
+
462
+ my ($ctl, $ctlExtra, $comment) = @{ *$self->{ZipData}{CentralHeader} };
463
+
464
+ my $sizes ;
465
+ if (! *$self->{ZipData}{Zip64}) {
466
+ $sizes .= *$self->{CompSize}->getPacked_V32() ; # Compressed size
467
+ $sizes .= *$self->{UnCompSize}->getPacked_V32() ; # Uncompressed size
468
+ }
469
+ else {
470
+ $sizes .= *$self->{CompSize}->getPacked_V64() ; # Compressed size
471
+ $sizes .= *$self->{UnCompSize}->getPacked_V64() ; # Uncompressed size
472
+ }
473
+
474
+ my $data = $crc32 . $sizes ;
475
+
476
+ my $xtrasize = *$self->{UnCompSize}->getPacked_V64() ; # Uncompressed size
477
+ $xtrasize .= *$self->{CompSize}->getPacked_V64() ; # Compressed size
478
+
479
+ my $hdr = '';
480
+
481
+ if (*$self->{ZipData}{Stream}) {
482
+ $hdr = pack "V", ZIP_DATA_HDR_SIG ; # signature
483
+ $hdr .= $data ;
484
+ }
485
+ else {
486
+ $self->writeAt(*$self->{ZipData}{LocalHdrOffset}->get64bit() + 14, $crc32)
487
+ or return undef;
488
+ $self->writeAt(*$self->{ZipData}{SizesOffset},
489
+ *$self->{ZipData}{Zip64} ? $xtrasize : $sizes)
490
+ or return undef;
491
+ }
492
+
493
+ # Central Header Record/Zip64 extended field
494
+
495
+ substr($ctl, 16, length $crc32) = $crc32 ;
496
+
497
+ my $zip64Payload = '';
498
+
499
+ # uncompressed length - only set zip64 if needed
500
+ if (*$self->{UnCompSize}->isAlmost64bit()) { # || *$self->{ZipData}{Zip64}) {
501
+ $zip64Payload .= *$self->{UnCompSize}->getPacked_V64() ;
502
+ } else {
503
+ substr($ctl, 24, 4) = *$self->{UnCompSize}->getPacked_V32() ;
504
+ }
505
+
506
+ # compressed length - only set zip64 if needed
507
+ if (*$self->{CompSize}->isAlmost64bit()) { # || *$self->{ZipData}{Zip64}) {
508
+ $zip64Payload .= *$self->{CompSize}->getPacked_V64() ;
509
+ } else {
510
+ substr($ctl, 20, 4) = *$self->{CompSize}->getPacked_V32() ;
511
+ }
512
+
513
+ # Local Header offset
514
+ $zip64Payload .= *$self->{ZipData}{LocalHdrOffset}->getPacked_V64()
515
+ if *$self->{ZipData}{LocalHdrOffset}->is64bit() ;
516
+
517
+ # disk no - always zero, so don't need to include it.
518
+ #$zip64Payload .= pack "V", 0 ;
519
+
520
+ my $zip64Xtra = '';
521
+
522
+ if (length $zip64Payload) {
523
+ $zip64Xtra = IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_ZIP64, $zip64Payload);
524
+
525
+ substr($ctl, *$self->{ZipData}{ExtraOffset}, 2) =
526
+ pack 'v', *$self->{ZipData}{ExtraSize} + length $zip64Xtra;
527
+
528
+ *$self->{ZipData}{AnyZip64} = 1;
529
+ }
530
+
531
+ # Zip64 needs to be first in extra field to workaround a Windows Explorer Bug
532
+ # See http://www.info-zip.org/phpBB3/viewtopic.php?f=3&t=440 for details
533
+ $ctl .= $zip64Xtra . $ctlExtra . $comment;
534
+
535
+ *$self->{ZipData}{Offset}->add32(length($hdr));
536
+ *$self->{ZipData}{Offset}->add( *$self->{CompSize} );
537
+ push @{ *$self->{ZipData}{CentralDir} }, $ctl ;
538
+
539
+ return $hdr;
540
+ }
541
+
542
+ sub mkFinalTrailer
543
+ {
544
+ my $self = shift ;
545
+
546
+ my $comment = '';
547
+ $comment = *$self->{ZipData}{ZipComment} ;
548
+
549
+ my $cd_offset = *$self->{ZipData}{Offset}->get32bit() ; # offset to start central dir
550
+
551
+ my $entries = @{ *$self->{ZipData}{CentralDir} };
552
+
553
+ *$self->{ZipData}{AnyZip64} = 1
554
+ if *$self->{ZipData}{Offset}->is64bit || $entries >= 0xFFFF ;
555
+
556
+ my $cd = join '', @{ *$self->{ZipData}{CentralDir} };
557
+ my $cd_len = length $cd ;
558
+
559
+ my $z64e = '';
560
+
561
+ if ( *$self->{ZipData}{AnyZip64} ) {
562
+
563
+ my $v = *$self->{ZipData}{Version} ;
564
+ my $mb = *$self->{ZipData}{MadeBy} ;
565
+ $z64e .= pack 'v', $mb ; # Version made by
566
+ $z64e .= pack 'v', $v ; # Version to extract
567
+ $z64e .= pack 'V', 0 ; # number of disk
568
+ $z64e .= pack 'V', 0 ; # number of disk with central dir
569
+ $z64e .= U64::pack_V64 $entries ; # entries in central dir on this disk
570
+ $z64e .= U64::pack_V64 $entries ; # entries in central dir
571
+ $z64e .= U64::pack_V64 $cd_len ; # size of central dir
572
+ $z64e .= *$self->{ZipData}{Offset}->getPacked_V64() ; # offset to start central dir
573
+ $z64e .= *$self->{ZipData}{extrafieldzip64} # otional extra field
574
+ if defined *$self->{ZipData}{extrafieldzip64} ;
575
+
576
+ $z64e = pack("V", ZIP64_END_CENTRAL_REC_HDR_SIG) # signature
577
+ . U64::pack_V64(length $z64e)
578
+ . $z64e ;
579
+
580
+ *$self->{ZipData}{Offset}->add32(length $cd) ;
581
+
582
+ $z64e .= pack "V", ZIP64_END_CENTRAL_LOC_HDR_SIG; # signature
583
+ $z64e .= pack 'V', 0 ; # number of disk with central dir
584
+ $z64e .= *$self->{ZipData}{Offset}->getPacked_V64() ; # offset to end zip64 central dir
585
+ $z64e .= pack 'V', 1 ; # Total number of disks
586
+
587
+ $cd_offset = IO::Compress::Base::Common::MAX32 ;
588
+ $cd_len = IO::Compress::Base::Common::MAX32 if IO::Compress::Base::Common::isGeMax32 $cd_len ;
589
+ $entries = 0xFFFF if $entries >= 0xFFFF ;
590
+ }
591
+
592
+ my $ecd = '';
593
+ $ecd .= pack "V", ZIP_END_CENTRAL_HDR_SIG ; # signature
594
+ $ecd .= pack 'v', 0 ; # number of disk
595
+ $ecd .= pack 'v', 0 ; # number of disk with central dir
596
+ $ecd .= pack 'v', $entries ; # entries in central dir on this disk
597
+ $ecd .= pack 'v', $entries ; # entries in central dir
598
+ $ecd .= pack 'V', $cd_len ; # size of central dir
599
+ $ecd .= pack 'V', $cd_offset ; # offset to start central dir
600
+ $ecd .= pack 'v', length $comment ; # zipfile comment length
601
+ $ecd .= $comment;
602
+
603
+ return $cd . $z64e . $ecd ;
604
+ }
605
+
606
+ sub ckParams
607
+ {
608
+ my $self = shift ;
609
+ my $got = shift;
610
+
611
+ $got->setValue('crc32' => 1);
612
+
613
+ if (! $got->parsed('time') ) {
614
+ # Modification time defaults to now.
615
+ $got->setValue('time' => time) ;
616
+ }
617
+
618
+ if ($got->parsed('extime') ) {
619
+ my $timeRef = $got->getValue('extime');
620
+ if ( defined $timeRef) {
621
+ return $self->saveErrorString(undef, "exTime not a 3-element array ref")
622
+ if ref $timeRef ne 'ARRAY' || @$timeRef != 3;
623
+ }
624
+
625
+ $got->setValue("mtime", $timeRef->[1]);
626
+ $got->setValue("atime", $timeRef->[0]);
627
+ $got->setValue("ctime", $timeRef->[2]);
628
+ }
629
+
630
+ # Unix2/3 Extended Attribute
631
+ for my $name (qw(exunix2 exunixn))
632
+ {
633
+ if ($got->parsed($name) ) {
634
+ my $idRef = $got->getValue($name);
635
+ if ( defined $idRef) {
636
+ return $self->saveErrorString(undef, "$name not a 2-element array ref")
637
+ if ref $idRef ne 'ARRAY' || @$idRef != 2;
638
+ }
639
+
640
+ $got->setValue("uid", $idRef->[0]);
641
+ $got->setValue("gid", $idRef->[1]);
642
+ $got->setValue("want_$name", $idRef);
643
+ }
644
+ }
645
+
646
+ *$self->{ZipData}{AnyZip64} = 1
647
+ if $got->getValue('zip64') || $got->getValue('extrafieldzip64') ;
648
+ *$self->{ZipData}{Zip64} = $got->getValue('zip64');
649
+ *$self->{ZipData}{Stream} = $got->getValue('stream');
650
+
651
+ my $method = $got->getValue('method');
652
+ return $self->saveErrorString(undef, "Unknown Method '$method'")
653
+ if ! defined $ZIP_CM_MIN_VERSIONS{$method};
654
+
655
+ return $self->saveErrorString(undef, "Bzip2 not available")
656
+ if $method == ZIP_CM_BZIP2 and
657
+ ! defined $IO::Compress::Adapter::Bzip2::VERSION;
658
+
659
+ return $self->saveErrorString(undef, "Lzma not available")
660
+ if $method == ZIP_CM_LZMA
661
+ and ! defined $IO::Compress::Adapter::Lzma::VERSION;
662
+
663
+ *$self->{ZipData}{Method} = $method;
664
+
665
+ *$self->{ZipData}{ZipComment} = $got->getValue('zipcomment') ;
666
+
667
+ for my $name (qw( extrafieldlocal extrafieldcentral extrafieldzip64))
668
+ {
669
+ my $data = $got->getValue($name) ;
670
+ if (defined $data) {
671
+ my $bad = IO::Compress::Zlib::Extra::parseExtraField($data, 1, 0) ;
672
+ return $self->saveErrorString(undef, "Error with $name Parameter: $bad")
673
+ if $bad ;
674
+
675
+ $got->setValue($name, $data) ;
676
+ *$self->{ZipData}{$name} = $data;
677
+ }
678
+ }
679
+
680
+ return undef
681
+ if defined $IO::Compress::Bzip2::VERSION
682
+ and ! IO::Compress::Bzip2::ckParams($self, $got);
683
+
684
+ if ($got->parsed('sparse') ) {
685
+ *$self->{ZipData}{Sparse} = $got->getValue('sparse') ;
686
+ *$self->{ZipData}{Method} = ZIP_CM_STORE;
687
+ }
688
+
689
+ if ($got->parsed('filtername')) {
690
+ my $v = $got->getValue('filtername') ;
691
+ *$self->{ZipData}{FilterName} = $v
692
+ if ref $v eq 'CODE' ;
693
+ }
694
+
695
+ return 1 ;
696
+ }
697
+
698
+ sub outputPayload
699
+ {
700
+ my $self = shift ;
701
+ return 1 if *$self->{ZipData}{Sparse} ;
702
+ return $self->output(@_);
703
+ }
704
+
705
+
706
+ #sub newHeader
707
+ #{
708
+ # my $self = shift ;
709
+ #
710
+ # return $self->mkHeader(*$self->{Got});
711
+ #}
712
+
713
+
714
+ our %PARAMS = (
715
+ 'stream' => [IO::Compress::Base::Common::Parse_boolean, 1],
716
+ #'store' => [IO::Compress::Base::Common::Parse_boolean, 0],
717
+ 'method' => [IO::Compress::Base::Common::Parse_unsigned, ZIP_CM_DEFLATE],
718
+
719
+ # # Zip header fields
720
+ 'minimal' => [IO::Compress::Base::Common::Parse_boolean, 0],
721
+ 'zip64' => [IO::Compress::Base::Common::Parse_boolean, 0],
722
+ 'comment' => [IO::Compress::Base::Common::Parse_any, ''],
723
+ 'zipcomment'=> [IO::Compress::Base::Common::Parse_any, ''],
724
+ 'name' => [IO::Compress::Base::Common::Parse_any, ''],
725
+ 'filtername'=> [IO::Compress::Base::Common::Parse_code, undef],
726
+ 'canonicalname'=> [IO::Compress::Base::Common::Parse_boolean, 0],
727
+ 'efs' => [IO::Compress::Base::Common::Parse_boolean, 0],
728
+ 'time' => [IO::Compress::Base::Common::Parse_any, undef],
729
+ 'extime' => [IO::Compress::Base::Common::Parse_any, undef],
730
+ 'exunix2' => [IO::Compress::Base::Common::Parse_any, undef],
731
+ 'exunixn' => [IO::Compress::Base::Common::Parse_any, undef],
732
+ 'extattr' => [IO::Compress::Base::Common::Parse_any,
733
+ $Compress::Raw::Zlib::gzip_os_code == 3
734
+ ? 0100644 << 16
735
+ : 0],
736
+ 'os_code' => [IO::Compress::Base::Common::Parse_unsigned, $Compress::Raw::Zlib::gzip_os_code],
737
+
738
+ 'textflag' => [IO::Compress::Base::Common::Parse_boolean, 0],
739
+ 'extrafieldlocal' => [IO::Compress::Base::Common::Parse_any, undef],
740
+ 'extrafieldcentral'=> [IO::Compress::Base::Common::Parse_any, undef],
741
+ 'extrafieldzip64' => [IO::Compress::Base::Common::Parse_any, undef],
742
+
743
+ # Lzma
744
+ 'preset' => [IO::Compress::Base::Common::Parse_unsigned, 6],
745
+ 'extreme' => [IO::Compress::Base::Common::Parse_boolean, 0],
746
+
747
+ # For internal use only
748
+ 'sparse' => [IO::Compress::Base::Common::Parse_unsigned, 0],
749
+
750
+ IO::Compress::RawDeflate::getZlibParams(),
751
+ defined $IO::Compress::Bzip2::VERSION
752
+ ? IO::Compress::Bzip2::getExtraParams()
753
+ : ()
754
+
755
+
756
+ );
757
+
758
+ sub getExtraParams
759
+ {
760
+ return %PARAMS ;
761
+ }
762
+
763
+ sub getInverseClass
764
+ {
765
+ no warnings 'once';
766
+ return ('IO::Uncompress::Unzip',
767
+ \$IO::Uncompress::Unzip::UnzipError);
768
+ }
769
+
770
+ sub getFileInfo
771
+ {
772
+ my $self = shift ;
773
+ my $params = shift;
774
+ my $filename = shift ;
775
+
776
+ if (IO::Compress::Base::Common::isaScalar($filename))
777
+ {
778
+ $params->setValue(zip64 => 1)
779
+ if IO::Compress::Base::Common::isGeMax32 length (${ $filename }) ;
780
+
781
+ return ;
782
+ }
783
+
784
+ my ($mode, $uid, $gid, $size, $atime, $mtime, $ctime) ;
785
+ if ( $params->parsed('storelinks') )
786
+ {
787
+ ($mode, $uid, $gid, $size, $atime, $mtime, $ctime)
788
+ = (lstat($filename))[2, 4,5,7, 8,9,10] ;
789
+ }
790
+ else
791
+ {
792
+ ($mode, $uid, $gid, $size, $atime, $mtime, $ctime)
793
+ = (stat($filename))[2, 4,5,7, 8,9,10] ;
794
+ }
795
+
796
+ $params->setValue(textflag => -T $filename )
797
+ if ! $params->parsed('textflag');
798
+
799
+ $params->setValue(zip64 => 1)
800
+ if IO::Compress::Base::Common::isGeMax32 $size ;
801
+
802
+ $params->setValue('name' => $filename)
803
+ if ! $params->parsed('name') ;
804
+
805
+ $params->setValue('time' => $mtime)
806
+ if ! $params->parsed('time') ;
807
+
808
+ if ( ! $params->parsed('extime'))
809
+ {
810
+ $params->setValue('mtime' => $mtime) ;
811
+ $params->setValue('atime' => $atime) ;
812
+ $params->setValue('ctime' => undef) ; # No Creation time
813
+ # TODO - see if can fillout creation time on non-Unix
814
+ }
815
+
816
+ # NOTE - Unix specific code alert
817
+ if (! $params->parsed('extattr'))
818
+ {
819
+ use Fcntl qw(:mode) ;
820
+ my $attr = $mode << 16;
821
+ $attr |= ZIP_A_RONLY if ($mode & S_IWRITE) == 0 ;
822
+ $attr |= ZIP_A_DIR if ($mode & S_IFMT ) == S_IFDIR ;
823
+
824
+ $params->setValue('extattr' => $attr);
825
+ }
826
+
827
+ $params->setValue('want_exunixn', [$uid, $gid]);
828
+ $params->setValue('uid' => $uid) ;
829
+ $params->setValue('gid' => $gid) ;
830
+
831
+ }
832
+
833
+ sub mkExtendedTime
834
+ {
835
+ # order expected is m, a, c
836
+
837
+ my $times = '';
838
+ my $bit = 1 ;
839
+ my $flags = 0;
840
+
841
+ for my $time (@_)
842
+ {
843
+ if (defined $time)
844
+ {
845
+ $flags |= $bit;
846
+ $times .= pack("V", $time);
847
+ }
848
+
849
+ $bit <<= 1 ;
850
+ }
851
+
852
+ return IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_EXT_TIMESTAMP,
853
+ pack("C", $flags) . $times);
854
+ }
855
+
856
+ sub mkUnix2Extra
857
+ {
858
+ my $ids = '';
859
+ for my $id (@_)
860
+ {
861
+ $ids .= pack("v", $id);
862
+ }
863
+
864
+ return IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_INFO_ZIP_UNIX2,
865
+ $ids);
866
+ }
867
+
868
+ sub mkUnixNExtra
869
+ {
870
+ my $uid = shift;
871
+ my $gid = shift;
872
+
873
+ # Assumes UID/GID are 32-bit
874
+ my $ids ;
875
+ $ids .= pack "C", 1; # version
876
+ $ids .= pack "C", $Config{uidsize};
877
+ $ids .= pack "V", $uid;
878
+ $ids .= pack "C", $Config{gidsize};
879
+ $ids .= pack "V", $gid;
880
+
881
+ return IO::Compress::Zlib::Extra::mkSubField(ZIP_EXTRA_ID_INFO_ZIP_UNIXN,
882
+ $ids);
883
+ }
884
+
885
+
886
+ # from Archive::Zip
887
+ sub _unixToDosTime # Archive::Zip::Member
888
+ {
889
+ my $time_t = shift;
890
+
891
+ # TODO - add something to cope with unix time < 1980
892
+ my ( $sec, $min, $hour, $mday, $mon, $year ) = localtime($time_t);
893
+ my $dt = 0;
894
+ $dt += ( $sec >> 1 );
895
+ $dt += ( $min << 5 );
896
+ $dt += ( $hour << 11 );
897
+ $dt += ( $mday << 16 );
898
+ $dt += ( ( $mon + 1 ) << 21 );
899
+ $dt += ( ( $year - 80 ) << 25 );
900
+ return $dt;
901
+ }
902
+
903
+ 1;
904
+
905
+ __END__
906
+
907
+ =head1 NAME
908
+
909
+ IO::Compress::Zip - Write zip files/buffers
910
+
911
+ =head1 SYNOPSIS
912
+
913
+ use IO::Compress::Zip qw(zip $ZipError) ;
914
+
915
+ my $status = zip $input => $output [,OPTS]
916
+ or die "zip failed: $ZipError\n";
917
+
918
+ my $z = IO::Compress::Zip->new( $output [,OPTS] )
919
+ or die "zip failed: $ZipError\n";
920
+
921
+ $z->print($string);
922
+ $z->printf($format, $string);
923
+ $z->write($string);
924
+ $z->syswrite($string [, $length, $offset]);
925
+ $z->flush();
926
+ $z->tell();
927
+ $z->eof();
928
+ $z->seek($position, $whence);
929
+ $z->binmode();
930
+ $z->fileno();
931
+ $z->opened();
932
+ $z->autoflush();
933
+ $z->input_line_number();
934
+ $z->newStream( [OPTS] );
935
+
936
+ $z->deflateParams();
937
+
938
+ $z->close() ;
939
+
940
+ $ZipError ;
941
+
942
+ # IO::File mode
943
+
944
+ print $z $string;
945
+ printf $z $format, $string;
946
+ tell $z
947
+ eof $z
948
+ seek $z, $position, $whence
949
+ binmode $z
950
+ fileno $z
951
+ close $z ;
952
+
953
+ =head1 DESCRIPTION
954
+
955
+ This module provides a Perl interface that allows writing zip
956
+ compressed data to files or buffer.
957
+
958
+ The primary purpose of this module is to provide streaming write access to
959
+ zip files and buffers.
960
+
961
+ At present the following compression methods are supported by IO::Compress::Zip
962
+
963
+ =over 5
964
+
965
+ =item Store (0)
966
+
967
+ =item Deflate (8)
968
+
969
+ =item Bzip2 (12)
970
+
971
+ To write Bzip2 content, the module C<IO::Uncompress::Bunzip2> must
972
+ be installed.
973
+
974
+ =item Lzma (14)
975
+
976
+ To write LZMA content, the module C<IO::Uncompress::UnLzma> must
977
+ be installed.
978
+
979
+ =item Zstandard (93)
980
+
981
+ To write Zstandard content, the module C<IO::Compress::Zstd> must
982
+ be installed.
983
+
984
+ =item Xz (95)
985
+
986
+ To write Xz content, the module C<IO::Uncompress::UnXz> must
987
+ be installed.
988
+
989
+ =back
990
+
991
+ For reading zip files/buffers, see the companion module
992
+ L<IO::Uncompress::Unzip|IO::Uncompress::Unzip>.
993
+
994
+ =head1 Functional Interface
995
+
996
+ A top-level function, C<zip>, is provided to carry out
997
+ "one-shot" compression between buffers and/or files. For finer
998
+ control over the compression process, see the L</"OO Interface">
999
+ section.
1000
+
1001
+ use IO::Compress::Zip qw(zip $ZipError) ;
1002
+
1003
+ zip $input_filename_or_reference => $output_filename_or_reference [,OPTS]
1004
+ or die "zip failed: $ZipError\n";
1005
+
1006
+ The functional interface needs Perl5.005 or better.
1007
+
1008
+ =head2 zip $input_filename_or_reference => $output_filename_or_reference [, OPTS]
1009
+
1010
+ C<zip> expects at least two parameters,
1011
+ C<$input_filename_or_reference> and C<$output_filename_or_reference>
1012
+ and zero or more optional parameters (see L</Optional Parameters>)
1013
+
1014
+ =head3 The C<$input_filename_or_reference> parameter
1015
+
1016
+ The parameter, C<$input_filename_or_reference>, is used to define the
1017
+ source of the uncompressed data.
1018
+
1019
+ It can take one of the following forms:
1020
+
1021
+ =over 5
1022
+
1023
+ =item A filename
1024
+
1025
+ If the C<$input_filename_or_reference> parameter is a simple scalar, it is
1026
+ assumed to be a filename. This file will be opened for reading and the
1027
+ input data will be read from it.
1028
+
1029
+ =item A filehandle
1030
+
1031
+ If the C<$input_filename_or_reference> parameter is a filehandle, the input
1032
+ data will be read from it. The string '-' can be used as an alias for
1033
+ standard input.
1034
+
1035
+ =item A scalar reference
1036
+
1037
+ If C<$input_filename_or_reference> is a scalar reference, the input data
1038
+ will be read from C<$$input_filename_or_reference>.
1039
+
1040
+ =item An array reference
1041
+
1042
+ If C<$input_filename_or_reference> is an array reference, each element in
1043
+ the array must be a filename.
1044
+
1045
+ The input data will be read from each file in turn.
1046
+
1047
+ The complete array will be walked to ensure that it only
1048
+ contains valid filenames before any data is compressed.
1049
+
1050
+ =item An Input FileGlob string
1051
+
1052
+ If C<$input_filename_or_reference> is a string that is delimited by the
1053
+ characters "<" and ">" C<zip> will assume that it is an
1054
+ I<input fileglob string>. The input is the list of files that match the
1055
+ fileglob.
1056
+
1057
+ See L<File::GlobMapper|File::GlobMapper> for more details.
1058
+
1059
+ =back
1060
+
1061
+ If the C<$input_filename_or_reference> parameter is any other type,
1062
+ C<undef> will be returned.
1063
+
1064
+ In addition, if C<$input_filename_or_reference> corresponds to a filename
1065
+ from the filesystem, a number of zip file header fields will be populated by default
1066
+ using the following attributes from the input file
1067
+
1068
+ =over 5
1069
+
1070
+ =item * the full filename contained in C<$input_filename_or_reference>
1071
+
1072
+ =item * the file protection attributes
1073
+
1074
+ =item * the UID/GID for the file
1075
+
1076
+ =item * the file timestamps
1077
+
1078
+ =back
1079
+
1080
+ If you do not want to use these defaults they can be overridden by
1081
+ explicitly setting one, or more, of the C<Name>, C<Time>, C<TextFlag>, C<ExtAttr>, C<exUnixN> and C<exTime> options or by setting the
1082
+ C<Minimal> parameter.
1083
+
1084
+ =head3 The C<$output_filename_or_reference> parameter
1085
+
1086
+ The parameter C<$output_filename_or_reference> is used to control the
1087
+ destination of the compressed data. This parameter can take one of
1088
+ these forms.
1089
+
1090
+ =over 5
1091
+
1092
+ =item A filename
1093
+
1094
+ If the C<$output_filename_or_reference> parameter is a simple scalar, it is
1095
+ assumed to be a filename. This file will be opened for writing and the
1096
+ compressed data will be written to it.
1097
+
1098
+ =item A filehandle
1099
+
1100
+ If the C<$output_filename_or_reference> parameter is a filehandle, the
1101
+ compressed data will be written to it. The string '-' can be used as
1102
+ an alias for standard output.
1103
+
1104
+ =item A scalar reference
1105
+
1106
+ If C<$output_filename_or_reference> is a scalar reference, the
1107
+ compressed data will be stored in C<$$output_filename_or_reference>.
1108
+
1109
+ =item An Array Reference
1110
+
1111
+ If C<$output_filename_or_reference> is an array reference,
1112
+ the compressed data will be pushed onto the array.
1113
+
1114
+ =item An Output FileGlob
1115
+
1116
+ If C<$output_filename_or_reference> is a string that is delimited by the
1117
+ characters "<" and ">" C<zip> will assume that it is an
1118
+ I<output fileglob string>. The output is the list of files that match the
1119
+ fileglob.
1120
+
1121
+ When C<$output_filename_or_reference> is an fileglob string,
1122
+ C<$input_filename_or_reference> must also be a fileglob string. Anything
1123
+ else is an error.
1124
+
1125
+ See L<File::GlobMapper|File::GlobMapper> for more details.
1126
+
1127
+ =back
1128
+
1129
+ If the C<$output_filename_or_reference> parameter is any other type,
1130
+ C<undef> will be returned.
1131
+
1132
+ =head2 Notes
1133
+
1134
+ When C<$input_filename_or_reference> maps to multiple files/buffers and
1135
+ C<$output_filename_or_reference> is a single
1136
+ file/buffer the input files/buffers will each be stored
1137
+ in C<$output_filename_or_reference> as a distinct entry.
1138
+
1139
+ =head2 Optional Parameters
1140
+
1141
+ The optional parameters for the one-shot function C<zip>
1142
+ are (for the most part) identical to those used with the OO interface defined in the
1143
+ L</"Constructor Options"> section. The exceptions are listed below
1144
+
1145
+ =over 5
1146
+
1147
+ =item C<< AutoClose => 0|1 >>
1148
+
1149
+ This option applies to any input or output data streams to
1150
+ C<zip> that are filehandles.
1151
+
1152
+ If C<AutoClose> is specified, and the value is true, it will result in all
1153
+ input and/or output filehandles being closed once C<zip> has
1154
+ completed.
1155
+
1156
+ This parameter defaults to 0.
1157
+
1158
+ =item C<< BinModeIn => 0|1 >>
1159
+
1160
+ This option is now a no-op. All files will be read in binmode.
1161
+
1162
+ =item C<< Append => 0|1 >>
1163
+
1164
+ The behaviour of this option is dependent on the type of output data
1165
+ stream.
1166
+
1167
+ =over 5
1168
+
1169
+ =item * A Buffer
1170
+
1171
+ If C<Append> is enabled, all compressed data will be append to the end of
1172
+ the output buffer. Otherwise the output buffer will be cleared before any
1173
+ compressed data is written to it.
1174
+
1175
+ =item * A Filename
1176
+
1177
+ If C<Append> is enabled, the file will be opened in append mode. Otherwise
1178
+ the contents of the file, if any, will be truncated before any compressed
1179
+ data is written to it.
1180
+
1181
+ =item * A Filehandle
1182
+
1183
+ If C<Append> is enabled, the filehandle will be positioned to the end of
1184
+ the file via a call to C<seek> before any compressed data is
1185
+ written to it. Otherwise the file pointer will not be moved.
1186
+
1187
+ =back
1188
+
1189
+ When C<Append> is specified, and set to true, it will I<append> all compressed
1190
+ data to the output data stream.
1191
+
1192
+ So when the output is a filehandle it will carry out a seek to the eof
1193
+ before writing any compressed data. If the output is a filename, it will be opened for
1194
+ appending. If the output is a buffer, all compressed data will be
1195
+ appended to the existing buffer.
1196
+
1197
+ Conversely when C<Append> is not specified, or it is present and is set to
1198
+ false, it will operate as follows.
1199
+
1200
+ When the output is a filename, it will truncate the contents of the file
1201
+ before writing any compressed data. If the output is a filehandle
1202
+ its position will not be changed. If the output is a buffer, it will be
1203
+ wiped before any compressed data is output.
1204
+
1205
+ Defaults to 0.
1206
+
1207
+ =back
1208
+
1209
+ =head2 Oneshot Examples
1210
+
1211
+ Here are a few example that show the capabilities of the module.
1212
+
1213
+ =head3 Streaming
1214
+
1215
+ This very simple command line example demonstrates the streaming capabilities of the module.
1216
+ The code reads data from STDIN, compresses it, and writes the compressed data to STDOUT.
1217
+
1218
+ $ echo hello world | perl -MIO::Compress::Zip=zip -e 'zip \*STDIN => \*STDOUT' >output.zip
1219
+
1220
+ The special filename "-" can be used as a standin for both C<\*STDIN> and C<\*STDOUT>,
1221
+ so the above can be rewritten as
1222
+
1223
+ $ echo hello world | perl -MIO::Compress::Zip=zip -e 'zip "-" => "-"' >output.zip
1224
+
1225
+ One problem with creating a zip archive directly from STDIN can be demonstrated by looking at
1226
+ the contents of the zip file, output.zip, that we have just created.
1227
+
1228
+ $ unzip -l output.zip
1229
+ Archive: output.zip
1230
+ Length Date Time Name
1231
+ --------- ---------- ----- ----
1232
+ 12 2019-08-16 22:21
1233
+ --------- -------
1234
+ 12 1 file
1235
+
1236
+ The archive member (filename) used is the empty string.
1237
+
1238
+ If that doesn't suit your needs, you can explicitly set the filename used
1239
+ in the zip archive by specifying the L<Name|"File Naming Options"> option, like so
1240
+
1241
+ echo hello world | perl -MIO::Compress::Zip=zip -e 'zip "-" => "-", Name => "hello.txt"' >output.zip
1242
+
1243
+ Now the contents of the zip file looks like this
1244
+
1245
+ $ unzip -l output.zip
1246
+ Archive: output.zip
1247
+ Length Date Time Name
1248
+ --------- ---------- ----- ----
1249
+ 12 2019-08-16 22:22 hello.txt
1250
+ --------- -------
1251
+ 12 1 file
1252
+
1253
+ =head3 Compressing a file from the filesystem
1254
+
1255
+ To read the contents of the file C<file1.txt> and write the compressed
1256
+ data to the file C<file1.txt.zip>.
1257
+
1258
+ use strict ;
1259
+ use warnings ;
1260
+ use IO::Compress::Zip qw(zip $ZipError) ;
1261
+
1262
+ my $input = "file1.txt";
1263
+ zip $input => "$input.zip"
1264
+ or die "zip failed: $ZipError\n";
1265
+
1266
+ =head3 Reading from a Filehandle and writing to an in-memory buffer
1267
+
1268
+ To read from an existing Perl filehandle, C<$input>, and write the
1269
+ compressed data to a buffer, C<$buffer>.
1270
+
1271
+ use strict ;
1272
+ use warnings ;
1273
+ use IO::Compress::Zip qw(zip $ZipError) ;
1274
+ use IO::File ;
1275
+
1276
+ my $input = IO::File->new( "<file1.txt" )
1277
+ or die "Cannot open 'file1.txt': $!\n" ;
1278
+ my $buffer ;
1279
+ zip $input => \$buffer
1280
+ or die "zip failed: $ZipError\n";
1281
+
1282
+ =head3 Compressing multiple files
1283
+
1284
+ To create a zip file, C<output.zip>, that contains the compressed contents
1285
+ of the files C<alpha.txt> and C<beta.txt>
1286
+
1287
+ use strict ;
1288
+ use warnings ;
1289
+ use IO::Compress::Zip qw(zip $ZipError) ;
1290
+
1291
+ zip [ 'alpha.txt', 'beta.txt' ] => 'output.zip'
1292
+ or die "zip failed: $ZipError\n";
1293
+
1294
+ Alternatively, rather than having to explicitly name each of the files that
1295
+ you want to compress, you could use a fileglob to select all the C<txt>
1296
+ files in the current directory, as follows
1297
+
1298
+ use strict ;
1299
+ use warnings ;
1300
+ use IO::Compress::Zip qw(zip $ZipError) ;
1301
+
1302
+ my @files = <*.txt>;
1303
+ zip \@files => 'output.zip'
1304
+ or die "zip failed: $ZipError\n";
1305
+
1306
+ or more succinctly
1307
+
1308
+ zip [ <*.txt> ] => 'output.zip'
1309
+ or die "zip failed: $ZipError\n";
1310
+
1311
+ =head1 OO Interface
1312
+
1313
+ =head2 Constructor
1314
+
1315
+ The format of the constructor for C<IO::Compress::Zip> is shown below
1316
+
1317
+ my $z = IO::Compress::Zip->new( $output [,OPTS] )
1318
+ or die "IO::Compress::Zip failed: $ZipError\n";
1319
+
1320
+ The constructor takes one mandatory parameter, C<$output>, defined below and
1321
+ zero or more C<OPTS>, defined in L<Constructor Options>.
1322
+
1323
+ It returns an C<IO::Compress::Zip> object on success and C<undef> on failure.
1324
+ The variable C<$ZipError> will contain an error message on failure.
1325
+
1326
+ If you are running Perl 5.005 or better the object, C<$z>, returned from
1327
+ IO::Compress::Zip can be used exactly like an L<IO::File|IO::File> filehandle.
1328
+ This means that all normal output file operations can be carried out
1329
+ with C<$z>.
1330
+ For example, to write to a compressed file/buffer you can use either of
1331
+ these forms
1332
+
1333
+ $z->print("hello world\n");
1334
+ print $z "hello world\n";
1335
+
1336
+ Below is a simple exaple of using the OO interface to create an output file
1337
+ C<myfile.zip> and write some data to it.
1338
+
1339
+ my $filename = "myfile.zip";
1340
+ my $z = IO::Compress::Zip->new($filename)
1341
+ or die "IO::Compress::Zip failed: $ZipError\n";
1342
+
1343
+ $z->print("abcde");
1344
+ $z->close();
1345
+
1346
+ See the L</Examples> for more.
1347
+
1348
+ The mandatory parameter C<$output> is used to control the destination
1349
+ of the compressed data. This parameter can take one of these forms.
1350
+
1351
+ =over 5
1352
+
1353
+ =item A filename
1354
+
1355
+ If the C<$output> parameter is a simple scalar, it is assumed to be a
1356
+ filename. This file will be opened for writing and the compressed data
1357
+ will be written to it.
1358
+
1359
+ =item A filehandle
1360
+
1361
+ If the C<$output> parameter is a filehandle, the compressed data will be
1362
+ written to it.
1363
+ The string '-' can be used as an alias for standard output.
1364
+
1365
+ =item A scalar reference
1366
+
1367
+ If C<$output> is a scalar reference, the compressed data will be stored
1368
+ in C<$$output>.
1369
+
1370
+ =back
1371
+
1372
+ If the C<$output> parameter is any other type, C<IO::Compress::Zip>::new will
1373
+ return undef.
1374
+
1375
+ =head2 Constructor Options
1376
+
1377
+ C<OPTS> is any combination of zero or more the following options:
1378
+
1379
+ =over 5
1380
+
1381
+ =item C<< AutoClose => 0|1 >>
1382
+
1383
+ This option is only valid when the C<$output> parameter is a filehandle. If
1384
+ specified, and the value is true, it will result in the C<$output> being
1385
+ closed once either the C<close> method is called or the C<IO::Compress::Zip>
1386
+ object is destroyed.
1387
+
1388
+ This parameter defaults to 0.
1389
+
1390
+ =item C<< Append => 0|1 >>
1391
+
1392
+ Opens C<$output> in append mode.
1393
+
1394
+ The behaviour of this option is dependent on the type of C<$output>.
1395
+
1396
+ =over 5
1397
+
1398
+ =item * A Buffer
1399
+
1400
+ If C<$output> is a buffer and C<Append> is enabled, all compressed data
1401
+ will be append to the end of C<$output>. Otherwise C<$output> will be
1402
+ cleared before any data is written to it.
1403
+
1404
+ =item * A Filename
1405
+
1406
+ If C<$output> is a filename and C<Append> is enabled, the file will be
1407
+ opened in append mode. Otherwise the contents of the file, if any, will be
1408
+ truncated before any compressed data is written to it.
1409
+
1410
+ =item * A Filehandle
1411
+
1412
+ If C<$output> is a filehandle, the file pointer will be positioned to the
1413
+ end of the file via a call to C<seek> before any compressed data is written
1414
+ to it. Otherwise the file pointer will not be moved.
1415
+
1416
+ =back
1417
+
1418
+ This parameter defaults to 0.
1419
+
1420
+ =back
1421
+
1422
+ =head3 File Naming Options
1423
+
1424
+ A quick bit of zip file terminology -- A zip archive consists of one or more I<archive members>, where each member has an associated
1425
+ filename, known as the I<archive member name>.
1426
+
1427
+ The options listed in this section control how the I<archive member name> (or filename) is stored the zip archive.
1428
+
1429
+ =over 5
1430
+
1431
+ =item C<< Name => $string >>
1432
+
1433
+ This option is used to explicitly set the I<archive member name> in
1434
+ the zip archive to C<$string>.
1435
+ Most of the time you don't need to make use of this option.
1436
+ By default when adding a filename to the zip archive, the I<archive member name> will match the filename.
1437
+
1438
+ You should only need to use this option if you want the I<archive member name>
1439
+ to be different from the uncompressed filename or when the input is a filehandle or a buffer.
1440
+
1441
+ The default behaviour for what I<archive member name> is used when the C<Name> option
1442
+ is I<not> specified depends on the form of the C<$input> parameter:
1443
+
1444
+ =over 5
1445
+
1446
+ =item *
1447
+
1448
+ If the C<$input> parameter is a filename, the
1449
+ value of C<$input> will be used for the I<archive member name> .
1450
+
1451
+ =item *
1452
+ If the C<$input> parameter is not a filename,
1453
+ the I<archive member name> will be an empty string.
1454
+
1455
+ =back
1456
+
1457
+ Note that both the C<CanonicalName> and C<FilterName> options
1458
+ can modify the value used for the I<archive member name>.
1459
+
1460
+ Also note that you should set the C<Efs> option to true if you are working
1461
+ with UTF8 filenames.
1462
+
1463
+ =item C<< CanonicalName => 0|1 >>
1464
+
1465
+ This option controls whether the I<archive member name> is
1466
+ I<normalized> into Unix format before being written to the zip file.
1467
+
1468
+ It is recommended that you enable this option unless you really need
1469
+ to create a non-standard Zip file.
1470
+
1471
+ This is what APPNOTE.TXT has to say on what should be stored in the zip
1472
+ filename header field.
1473
+
1474
+ The name of the file, with optional relative path.
1475
+ The path stored should not contain a drive or
1476
+ device letter, or a leading slash. All slashes
1477
+ should be forward slashes '/' as opposed to
1478
+ backwards slashes '\' for compatibility with Amiga
1479
+ and UNIX file systems etc.
1480
+
1481
+ This option defaults to B<false>.
1482
+
1483
+ =item C<< FilterName => sub { ... } >>
1484
+
1485
+ This option allow the I<archive member> name to be modified
1486
+ before it is written to the zip file.
1487
+
1488
+ This option takes a parameter that must be a reference to a sub. On entry
1489
+ to the sub the C<$_> variable will contain the name to be filtered. If no
1490
+ filename is available C<$_> will contain an empty string.
1491
+
1492
+ The value of C<$_> when the sub returns will be used as the I<archive member name>.
1493
+
1494
+ Note that if C<CanonicalName> is enabled, a
1495
+ normalized filename will be passed to the sub.
1496
+
1497
+ If you use C<FilterName> to modify the filename, it is your responsibility
1498
+ to keep the filename in Unix format.
1499
+
1500
+ Although this option can be used with the OO interface, it is of most use
1501
+ with the one-shot interface. For example, the code below shows how
1502
+ C<FilterName> can be used to remove the path component from a series of
1503
+ filenames before they are stored in C<$zipfile>.
1504
+
1505
+ sub compressTxtFiles
1506
+ {
1507
+ my $zipfile = shift ;
1508
+ my $dir = shift ;
1509
+
1510
+ zip [ <$dir/*.txt> ] => $zipfile,
1511
+ FilterName => sub { s[^$dir/][] } ;
1512
+ }
1513
+
1514
+ =item C<< Efs => 0|1 >>
1515
+
1516
+ This option controls setting of the "Language Encoding Flag" (EFS) in the zip
1517
+ archive. When set, the filename and comment fields for the zip archive MUST
1518
+ be valid UTF-8.
1519
+
1520
+ If the string used for the filename and/or comment is not valid UTF-8 when this option
1521
+ is true, the script will die with a "wide character" error.
1522
+
1523
+ Note that this option only works with Perl 5.8.4 or better.
1524
+
1525
+ This option defaults to B<false>.
1526
+
1527
+ =back
1528
+
1529
+ =head3 Overall Zip Archive Structure
1530
+
1531
+ =over 5
1532
+
1533
+ =item C<< Minimal => 1|0 >>
1534
+
1535
+ If specified, this option will disable the creation of all extra fields
1536
+ in the zip local and central headers. So the C<exTime>, C<exUnix2>,
1537
+ C<exUnixN>, C<ExtraFieldLocal> and C<ExtraFieldCentral> options will
1538
+ be ignored.
1539
+
1540
+ This parameter defaults to 0.
1541
+
1542
+ =item C<< Stream => 0|1 >>
1543
+
1544
+ This option controls whether the zip file/buffer output is created in
1545
+ streaming mode.
1546
+
1547
+ Note that when outputting to a file with streaming mode disabled (C<Stream>
1548
+ is 0), the output file must be seekable.
1549
+
1550
+ The default is 1.
1551
+
1552
+ =item C<< Zip64 => 0|1 >>
1553
+
1554
+ Create a Zip64 zip file/buffer. This option is used if you want
1555
+ to store files larger than 4 Gig or store more than 64K files in a single
1556
+ zip archive.
1557
+
1558
+ C<Zip64> will be automatically set, as needed, if working with the one-shot
1559
+ interface when the input is either a filename or a scalar reference.
1560
+
1561
+ If you intend to manipulate the Zip64 zip files created with this module
1562
+ using an external zip/unzip, make sure that it supports Zip64.
1563
+
1564
+ In particular, if you are using Info-Zip you need to have zip version 3.x
1565
+ or better to update a Zip64 archive and unzip version 6.x to read a zip64
1566
+ archive.
1567
+
1568
+ The default is 0.
1569
+
1570
+ =back
1571
+
1572
+ =head3 Deflate Compression Options
1573
+
1574
+ =over 5
1575
+
1576
+ =item -Level
1577
+
1578
+ Defines the compression level used by zlib. The value should either be
1579
+ a number between 0 and 9 (0 means no compression and 9 is maximum
1580
+ compression), or one of the symbolic constants defined below.
1581
+
1582
+ Z_NO_COMPRESSION
1583
+ Z_BEST_SPEED
1584
+ Z_BEST_COMPRESSION
1585
+ Z_DEFAULT_COMPRESSION
1586
+
1587
+ The default is Z_DEFAULT_COMPRESSION.
1588
+
1589
+ Note, these constants are not imported by C<IO::Compress::Zip> by default.
1590
+
1591
+ use IO::Compress::Zip qw(:strategy);
1592
+ use IO::Compress::Zip qw(:constants);
1593
+ use IO::Compress::Zip qw(:all);
1594
+
1595
+ =item -Strategy
1596
+
1597
+ Defines the strategy used to tune the compression. Use one of the symbolic
1598
+ constants defined below.
1599
+
1600
+ Z_FILTERED
1601
+ Z_HUFFMAN_ONLY
1602
+ Z_RLE
1603
+ Z_FIXED
1604
+ Z_DEFAULT_STRATEGY
1605
+
1606
+ The default is Z_DEFAULT_STRATEGY.
1607
+
1608
+ =back
1609
+
1610
+ =head3 Bzip2 Compression Options
1611
+
1612
+ =over 5
1613
+
1614
+ =item C<< BlockSize100K => number >>
1615
+
1616
+ Specify the number of 100K blocks bzip2 uses during compression.
1617
+
1618
+ Valid values are from 1 to 9, where 9 is best compression.
1619
+
1620
+ This option is only valid if the C<Method> is ZIP_CM_BZIP2. It is ignored
1621
+ otherwise.
1622
+
1623
+ The default is 1.
1624
+
1625
+ =item C<< WorkFactor => number >>
1626
+
1627
+ Specifies how much effort bzip2 should take before resorting to a slower
1628
+ fallback compression algorithm.
1629
+
1630
+ Valid values range from 0 to 250, where 0 means use the default value 30.
1631
+
1632
+ This option is only valid if the C<Method> is ZIP_CM_BZIP2. It is ignored
1633
+ otherwise.
1634
+
1635
+ The default is 0.
1636
+
1637
+ =back
1638
+
1639
+ =head3 Lzma and Xz Compression Options
1640
+
1641
+ =over 5
1642
+
1643
+ =item C<< Preset => number >>
1644
+
1645
+ Used to choose the LZMA compression preset.
1646
+
1647
+ Valid values are 0-9 and C<LZMA_PRESET_DEFAULT>.
1648
+
1649
+ 0 is the fastest compression with the lowest memory usage and the lowest
1650
+ compression.
1651
+
1652
+ 9 is the slowest compression with the highest memory usage but with the best
1653
+ compression.
1654
+
1655
+ This option is only valid if the C<Method> is ZIP_CM_LZMA. It is ignored
1656
+ otherwise.
1657
+
1658
+ Defaults to C<LZMA_PRESET_DEFAULT> (6).
1659
+
1660
+ =item C<< Extreme => 0|1 >>
1661
+
1662
+ Makes LZMA compression a lot slower, but a small compression gain.
1663
+
1664
+ This option is only valid if the C<Method> is ZIP_CM_LZMA. It is ignored
1665
+ otherwise.
1666
+
1667
+ Defaults to 0.
1668
+
1669
+ =back
1670
+
1671
+ =head3 Other Options
1672
+
1673
+ =over 5
1674
+
1675
+ =item C<< Time => $number >>
1676
+
1677
+ Sets the last modified time field in the zip header to $number.
1678
+
1679
+ This field defaults to the time the C<IO::Compress::Zip> object was created
1680
+ if this option is not specified and the C<$input> parameter is not a
1681
+ filename.
1682
+
1683
+ =item C<< ExtAttr => $attr >>
1684
+
1685
+ This option controls the "external file attributes" field in the central
1686
+ header of the zip file. This is a 4 byte field.
1687
+
1688
+ If you are running a Unix derivative this value defaults to
1689
+
1690
+ 0100644 << 16
1691
+
1692
+ This should allow read/write access to any files that are extracted from
1693
+ the zip file/buffer`.
1694
+
1695
+ For all other systems it defaults to 0.
1696
+
1697
+ =item C<< exTime => [$atime, $mtime, $ctime] >>
1698
+
1699
+ This option expects an array reference with exactly three elements:
1700
+ C<$atime>, C<mtime> and C<$ctime>. These correspond to the last access
1701
+ time, last modification time and creation time respectively.
1702
+
1703
+ It uses these values to set the extended timestamp field (ID is "UT") in
1704
+ the local zip header using the three values, $atime, $mtime, $ctime. In
1705
+ addition it sets the extended timestamp field in the central zip header
1706
+ using C<$mtime>.
1707
+
1708
+ If any of the three values is C<undef> that time value will not be used.
1709
+ So, for example, to set only the C<$mtime> you would use this
1710
+
1711
+ exTime => [undef, $mtime, undef]
1712
+
1713
+ If the C<Minimal> option is set to true, this option will be ignored.
1714
+
1715
+ By default no extended time field is created.
1716
+
1717
+ =item C<< exUnix2 => [$uid, $gid] >>
1718
+
1719
+ This option expects an array reference with exactly two elements: C<$uid>
1720
+ and C<$gid>. These values correspond to the numeric User ID (UID) and Group ID
1721
+ (GID) of the owner of the files respectively.
1722
+
1723
+ When the C<exUnix2> option is present it will trigger the creation of a
1724
+ Unix2 extra field (ID is "Ux") in the local zip header. This will be populated
1725
+ with C<$uid> and C<$gid>. An empty Unix2 extra field will also
1726
+ be created in the central zip header.
1727
+
1728
+ Note - The UID & GID are stored as 16-bit
1729
+ integers in the "Ux" field. Use C<< exUnixN >> if your UID or GID are
1730
+ 32-bit.
1731
+
1732
+ If the C<Minimal> option is set to true, this option will be ignored.
1733
+
1734
+ By default no Unix2 extra field is created.
1735
+
1736
+ =item C<< exUnixN => [$uid, $gid] >>
1737
+
1738
+ This option expects an array reference with exactly two elements: C<$uid>
1739
+ and C<$gid>. These values correspond to the numeric User ID (UID) and Group ID
1740
+ (GID) of the owner of the files respectively.
1741
+
1742
+ When the C<exUnixN> option is present it will trigger the creation of a
1743
+ UnixN extra field (ID is "ux") in both the local and central zip headers.
1744
+ This will be populated with C<$uid> and C<$gid>.
1745
+ The UID & GID are stored as 32-bit integers.
1746
+
1747
+ If the C<Minimal> option is set to true, this option will be ignored.
1748
+
1749
+ By default no UnixN extra field is created.
1750
+
1751
+ =item C<< Comment => $comment >>
1752
+
1753
+ Stores the contents of C<$comment> in the Central File Header of
1754
+ the zip file.
1755
+
1756
+ Set the C<Efs> option to true if you want to store a UTF8 comment.
1757
+
1758
+ By default, no comment field is written to the zip file.
1759
+
1760
+ =item C<< ZipComment => $comment >>
1761
+
1762
+ Stores the contents of C<$comment> in the End of Central Directory record
1763
+ of the zip file.
1764
+
1765
+ By default, no comment field is written to the zip file.
1766
+
1767
+ =item C<< Method => $method >>
1768
+
1769
+ Controls which compression method is used. At present the compression
1770
+ methods supported are: Store (no compression at all), Deflate,
1771
+ Bzip2, Zstd, Xz and Lzma.
1772
+
1773
+ The symbols ZIP_CM_STORE, ZIP_CM_DEFLATE, ZIP_CM_BZIP2, ZIP_CM_ZSTD, ZIP_CM_XZ and ZIP_CM_LZMA
1774
+ are used to select the compression method.
1775
+
1776
+ These constants are not imported by C<IO::Compress::Zip> by default.
1777
+
1778
+ use IO::Compress::Zip qw(:zip_method);
1779
+ use IO::Compress::Zip qw(:constants);
1780
+ use IO::Compress::Zip qw(:all);
1781
+
1782
+ Note that to create Bzip2 content, the module C<IO::Compress::Bzip2> must
1783
+ be installed. A fatal error will be thrown if you attempt to create Bzip2
1784
+ content when C<IO::Compress::Bzip2> is not available.
1785
+
1786
+ Note that to create Lzma content, the module C<IO::Compress::Lzma> must
1787
+ be installed. A fatal error will be thrown if you attempt to create Lzma
1788
+ content when C<IO::Compress::Lzma> is not available.
1789
+
1790
+ Note that to create Xz content, the module C<IO::Compress::Xz> must
1791
+ be installed. A fatal error will be thrown if you attempt to create Xz
1792
+ content when C<IO::Compress::Xz> is not available.
1793
+
1794
+ Note that to create Zstd content, the module C<IO::Compress::Zstd> must
1795
+ be installed. A fatal error will be thrown if you attempt to create Zstd
1796
+ content when C<IO::Compress::Zstd> is not available.
1797
+
1798
+ The default method is ZIP_CM_DEFLATE.
1799
+
1800
+ =item C<< TextFlag => 0|1 >>
1801
+
1802
+ This parameter controls the setting of a bit in the zip central header. It
1803
+ is used to signal that the data stored in the zip file/buffer is probably
1804
+ text.
1805
+
1806
+ In one-shot mode this flag will be set to true if the Perl C<-T> operator thinks
1807
+ the file contains text.
1808
+
1809
+ The default is 0.
1810
+
1811
+ =item C<< ExtraFieldLocal => $data >>
1812
+
1813
+ =item C<< ExtraFieldCentral => $data >>
1814
+
1815
+ The C<ExtraFieldLocal> option is used to store additional metadata in the
1816
+ local header for the zip file/buffer. The C<ExtraFieldCentral> does the
1817
+ same for the matching central header.
1818
+
1819
+ An extra field consists of zero or more subfields. Each subfield consists
1820
+ of a two byte header followed by the subfield data.
1821
+
1822
+ The list of subfields can be supplied in any of the following formats
1823
+
1824
+ ExtraFieldLocal => [$id1, $data1,
1825
+ $id2, $data2,
1826
+ ...
1827
+ ]
1828
+
1829
+ ExtraFieldLocal => [ [$id1 => $data1],
1830
+ [$id2 => $data2],
1831
+ ...
1832
+ ]
1833
+
1834
+ ExtraFieldLocal => { $id1 => $data1,
1835
+ $id2 => $data2,
1836
+ ...
1837
+ }
1838
+
1839
+ Where C<$id1>, C<$id2> are two byte subfield ID's.
1840
+
1841
+ If you use the hash syntax, you have no control over the order in which
1842
+ the ExtraSubFields are stored, plus you cannot have SubFields with
1843
+ duplicate ID.
1844
+
1845
+ Alternatively the list of subfields can by supplied as a scalar, thus
1846
+
1847
+ ExtraField => $rawdata
1848
+
1849
+ In this case C<IO::Compress::Zip> will check that C<$rawdata> consists of
1850
+ zero or more conformant sub-fields.
1851
+
1852
+ The Extended Time field (ID "UT"), set using the C<exTime> option, and the
1853
+ Unix2 extra field (ID "Ux), set using the C<exUnix2> option, are examples
1854
+ of extra fields.
1855
+
1856
+ If the C<Minimal> option is set to true, this option will be ignored.
1857
+
1858
+ The maximum size of an extra field 65535 bytes.
1859
+
1860
+ =item C<< Strict => 0|1 >>
1861
+
1862
+ This is a placeholder option.
1863
+
1864
+ =back
1865
+
1866
+ =head2 Examples
1867
+
1868
+ =head3 Streaming
1869
+
1870
+ This very simple command line example demonstrates the streaming capabilities
1871
+ of the module. The code reads data from STDIN or all the files given on the
1872
+ commandline, compresses it, and writes the compressed data to STDOUT.
1873
+
1874
+ use strict ;
1875
+ use warnings ;
1876
+ use IO::Compress::Zip qw(zip $ZipError) ;
1877
+
1878
+ my $z = IO::Compress::Zip->new("-", Stream => 1)
1879
+ or die "IO::Compress::Zip failed: $ZipError\n";
1880
+
1881
+ while (<>) {
1882
+ $z->print("abcde");
1883
+ }
1884
+ $z->close();
1885
+
1886
+ Note the use of C<"-"> to means C<STDOUT>. Alternatively you can use C<\*STDOUT>.
1887
+
1888
+ One problem with creating a zip archive directly from STDIN can be demonstrated by looking at
1889
+ the contents of the zip file, output.zip, that we have just created
1890
+ (assumg you have redirected it to a file called C<output.zip>).
1891
+
1892
+ $ unzip -l output.zip
1893
+ Archive: output.zip
1894
+ Length Date Time Name
1895
+ --------- ---------- ----- ----
1896
+ 12 2019-08-16 22:21
1897
+ --------- -------
1898
+ 12 1 file
1899
+
1900
+ The archive member (filename) used is the empty string.
1901
+
1902
+ If that doesn't suit your needs, you can explicitly set the filename used
1903
+ in the zip archive by specifying the L<Name|"File Naming Options"> option, like so
1904
+
1905
+ my $z = IO::Compress::Zip->new("-", Name => "hello.txt", Stream => 1)
1906
+
1907
+ Now the contents of the zip file looks like this
1908
+
1909
+ $ unzip -l output.zip
1910
+ Archive: output.zip
1911
+ Length Date Time Name
1912
+ --------- ---------- ----- ----
1913
+ 12 2019-08-16 22:22 hello.txt
1914
+ --------- -------
1915
+ 12 1 file
1916
+
1917
+ =head3 Compressing a file from the filesystem
1918
+
1919
+ To read the contents of the file C<file1.txt> and write the compressed
1920
+ data to the file C<file1.txt.zip> there are a few options
1921
+
1922
+ Start by creating the compression object and opening the input file
1923
+
1924
+ use strict ;
1925
+ use warnings ;
1926
+ use IO::Compress::Zip qw(zip $ZipError) ;
1927
+
1928
+ my $input = "file1.txt";
1929
+ my $z = IO::Compress::Zip->new("file1.txt.zip")
1930
+ or die "IO::Compress::Zip failed: $ZipError\n";
1931
+
1932
+ # open the input file
1933
+ open my $fh, "<", "file1.txt"
1934
+ or die "Cannot open file1.txt: $!\n";
1935
+
1936
+ # loop through the input file & write to the compressed file
1937
+ while (<$fh>) {
1938
+ $z->print($_);
1939
+ }
1940
+
1941
+ # not forgetting to close the compressed file
1942
+ $z->close();
1943
+
1944
+ =head3 Compressing multiple files
1945
+
1946
+ To create a zip file, C<output.zip>, that contains the compressed contents
1947
+ of the files C<alpha.txt> and C<beta.txt>
1948
+
1949
+ use strict ;
1950
+ use warnings ;
1951
+ use IO::Compress::Zip qw(zip $ZipError) ;
1952
+
1953
+ my $z = IO::Compress::Zip->new("output.zip", Name => "alpha.txt")
1954
+ or die "IO::Compress::Zip failed: $ZipError\n";
1955
+
1956
+ # open the input file
1957
+ open my $fh, "<", "file1.txt"
1958
+ or die "Cannot open file1.txt: $!\n";
1959
+
1960
+ # loop through the input file & write to the compressed file
1961
+ while (<$fh>) {
1962
+ $z->print($_);
1963
+ }
1964
+
1965
+ # move to next file
1966
+ $z->newStream(Name => "beta.txt")
1967
+
1968
+ while (<$fh>) {
1969
+ $z->print($_);
1970
+ }
1971
+
1972
+ $z->close();
1973
+
1974
+ =head1 Methods
1975
+
1976
+ =head2 print
1977
+
1978
+ Usage is
1979
+
1980
+ $z->print($data)
1981
+ print $z $data
1982
+
1983
+ Compresses and outputs the contents of the C<$data> parameter. This
1984
+ has the same behaviour as the C<print> built-in.
1985
+
1986
+ Returns true if successful.
1987
+
1988
+ =head2 printf
1989
+
1990
+ Usage is
1991
+
1992
+ $z->printf($format, $data)
1993
+ printf $z $format, $data
1994
+
1995
+ Compresses and outputs the contents of the C<$data> parameter.
1996
+
1997
+ Returns true if successful.
1998
+
1999
+ =head2 syswrite
2000
+
2001
+ Usage is
2002
+
2003
+ $z->syswrite $data
2004
+ $z->syswrite $data, $length
2005
+ $z->syswrite $data, $length, $offset
2006
+
2007
+ Compresses and outputs the contents of the C<$data> parameter.
2008
+
2009
+ Returns the number of uncompressed bytes written, or C<undef> if
2010
+ unsuccessful.
2011
+
2012
+ =head2 write
2013
+
2014
+ Usage is
2015
+
2016
+ $z->write $data
2017
+ $z->write $data, $length
2018
+ $z->write $data, $length, $offset
2019
+
2020
+ Compresses and outputs the contents of the C<$data> parameter.
2021
+
2022
+ Returns the number of uncompressed bytes written, or C<undef> if
2023
+ unsuccessful.
2024
+
2025
+ =head2 flush
2026
+
2027
+ Usage is
2028
+
2029
+ $z->flush;
2030
+ $z->flush($flush_type);
2031
+
2032
+ Flushes any pending compressed data to the output file/buffer.
2033
+
2034
+ This method takes an optional parameter, C<$flush_type>, that controls
2035
+ how the flushing will be carried out. By default the C<$flush_type>
2036
+ used is C<Z_FINISH>. Other valid values for C<$flush_type> are
2037
+ C<Z_NO_FLUSH>, C<Z_SYNC_FLUSH>, C<Z_FULL_FLUSH> and C<Z_BLOCK>. It is
2038
+ strongly recommended that you only set the C<flush_type> parameter if
2039
+ you fully understand the implications of what it does - overuse of C<flush>
2040
+ can seriously degrade the level of compression achieved. See the C<zlib>
2041
+ documentation for details.
2042
+
2043
+ Returns true on success.
2044
+
2045
+ =head2 tell
2046
+
2047
+ Usage is
2048
+
2049
+ $z->tell()
2050
+ tell $z
2051
+
2052
+ Returns the uncompressed file offset.
2053
+
2054
+ =head2 eof
2055
+
2056
+ Usage is
2057
+
2058
+ $z->eof();
2059
+ eof($z);
2060
+
2061
+ Returns true if the C<close> method has been called.
2062
+
2063
+ =head2 seek
2064
+
2065
+ $z->seek($position, $whence);
2066
+ seek($z, $position, $whence);
2067
+
2068
+ Provides a sub-set of the C<seek> functionality, with the restriction
2069
+ that it is only legal to seek forward in the output file/buffer.
2070
+ It is a fatal error to attempt to seek backward.
2071
+
2072
+ Empty parts of the file/buffer will have NULL (0x00) bytes written to them.
2073
+
2074
+ The C<$whence> parameter takes one the usual values, namely SEEK_SET,
2075
+ SEEK_CUR or SEEK_END.
2076
+
2077
+ Returns 1 on success, 0 on failure.
2078
+
2079
+ =head2 binmode
2080
+
2081
+ Usage is
2082
+
2083
+ $z->binmode
2084
+ binmode $z ;
2085
+
2086
+ This is a noop provided for completeness.
2087
+
2088
+ =head2 opened
2089
+
2090
+ $z->opened()
2091
+
2092
+ Returns true if the object currently refers to a opened file/buffer.
2093
+
2094
+ =head2 autoflush
2095
+
2096
+ my $prev = $z->autoflush()
2097
+ my $prev = $z->autoflush(EXPR)
2098
+
2099
+ If the C<$z> object is associated with a file or a filehandle, this method
2100
+ returns the current autoflush setting for the underlying filehandle. If
2101
+ C<EXPR> is present, and is non-zero, it will enable flushing after every
2102
+ write/print operation.
2103
+
2104
+ If C<$z> is associated with a buffer, this method has no effect and always
2105
+ returns C<undef>.
2106
+
2107
+ B<Note> that the special variable C<$|> B<cannot> be used to set or
2108
+ retrieve the autoflush setting.
2109
+
2110
+ =head2 input_line_number
2111
+
2112
+ $z->input_line_number()
2113
+ $z->input_line_number(EXPR)
2114
+
2115
+ This method always returns C<undef> when compressing.
2116
+
2117
+ =head2 fileno
2118
+
2119
+ $z->fileno()
2120
+ fileno($z)
2121
+
2122
+ If the C<$z> object is associated with a file or a filehandle, C<fileno>
2123
+ will return the underlying file descriptor. Once the C<close> method is
2124
+ called C<fileno> will return C<undef>.
2125
+
2126
+ If the C<$z> object is associated with a buffer, this method will return
2127
+ C<undef>.
2128
+
2129
+ =head2 close
2130
+
2131
+ $z->close() ;
2132
+ close $z ;
2133
+
2134
+ Flushes any pending compressed data and then closes the output file/buffer.
2135
+
2136
+ For most versions of Perl this method will be automatically invoked if
2137
+ the IO::Compress::Zip object is destroyed (either explicitly or by the
2138
+ variable with the reference to the object going out of scope). The
2139
+ exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In
2140
+ these cases, the C<close> method will be called automatically, but
2141
+ not until global destruction of all live objects when the program is
2142
+ terminating.
2143
+
2144
+ Therefore, if you want your scripts to be able to run on all versions
2145
+ of Perl, you should call C<close> explicitly and not rely on automatic
2146
+ closing.
2147
+
2148
+ Returns true on success, otherwise 0.
2149
+
2150
+ If the C<AutoClose> option has been enabled when the IO::Compress::Zip
2151
+ object was created, and the object is associated with a file, the
2152
+ underlying file will also be closed.
2153
+
2154
+ =head2 newStream([OPTS])
2155
+
2156
+ Usage is
2157
+
2158
+ $z->newStream( [OPTS] )
2159
+
2160
+ Closes the current compressed data stream and starts a new one.
2161
+
2162
+ OPTS consists of any of the options that are available when creating
2163
+ the C<$z> object.
2164
+
2165
+ See the L</"Constructor Options"> section for more details.
2166
+
2167
+ =head2 deflateParams
2168
+
2169
+ Usage is
2170
+
2171
+ $z->deflateParams
2172
+
2173
+ TODO
2174
+
2175
+ =head1 Importing
2176
+
2177
+ A number of symbolic constants are required by some methods in
2178
+ C<IO::Compress::Zip>. None are imported by default.
2179
+
2180
+ =over 5
2181
+
2182
+ =item :all
2183
+
2184
+ Imports C<zip>, C<$ZipError> and all symbolic
2185
+ constants that can be used by C<IO::Compress::Zip>. Same as doing this
2186
+
2187
+ use IO::Compress::Zip qw(zip $ZipError :constants) ;
2188
+
2189
+ =item :constants
2190
+
2191
+ Import all symbolic constants. Same as doing this
2192
+
2193
+ use IO::Compress::Zip qw(:flush :level :strategy :zip_method) ;
2194
+
2195
+ =item :flush
2196
+
2197
+ These symbolic constants are used by the C<flush> method.
2198
+
2199
+ Z_NO_FLUSH
2200
+ Z_PARTIAL_FLUSH
2201
+ Z_SYNC_FLUSH
2202
+ Z_FULL_FLUSH
2203
+ Z_FINISH
2204
+ Z_BLOCK
2205
+
2206
+ =item :level
2207
+
2208
+ These symbolic constants are used by the C<Level> option in the constructor.
2209
+
2210
+ Z_NO_COMPRESSION
2211
+ Z_BEST_SPEED
2212
+ Z_BEST_COMPRESSION
2213
+ Z_DEFAULT_COMPRESSION
2214
+
2215
+ =item :strategy
2216
+
2217
+ These symbolic constants are used by the C<Strategy> option in the constructor.
2218
+
2219
+ Z_FILTERED
2220
+ Z_HUFFMAN_ONLY
2221
+ Z_RLE
2222
+ Z_FIXED
2223
+ Z_DEFAULT_STRATEGY
2224
+
2225
+ =item :zip_method
2226
+
2227
+ These symbolic constants are used by the C<Method> option in the
2228
+ constructor.
2229
+
2230
+ ZIP_CM_STORE
2231
+ ZIP_CM_DEFLATE
2232
+ ZIP_CM_BZIP2
2233
+
2234
+ =back
2235
+
2236
+ =head1 EXAMPLES
2237
+
2238
+ =head2 Apache::GZip Revisited
2239
+
2240
+ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Apache::GZip Revisited">
2241
+
2242
+ =head2 Working with Net::FTP
2243
+
2244
+ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
2245
+
2246
+ =head1 SUPPORT
2247
+
2248
+ General feedback/questions/bug reports should be sent to
2249
+ L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
2250
+ L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
2251
+
2252
+ =head1 SEE ALSO
2253
+
2254
+ L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
2255
+
2256
+ L<IO::Compress::FAQ|IO::Compress::FAQ>
2257
+
2258
+ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
2259
+ L<Archive::Tar|Archive::Tar>,
2260
+ L<IO::Zlib|IO::Zlib>
2261
+
2262
+ For RFC 1950, 1951 and 1952 see
2263
+ L<https://datatracker.ietf.org/doc/html/rfc1950>,
2264
+ L<https://datatracker.ietf.org/doc/html/rfc1951> and
2265
+ L<https://datatracker.ietf.org/doc/html/rfc1952>
2266
+
2267
+ The I<zlib> compression library was written by Jean-loup Gailly
2268
+ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>.
2269
+
2270
+ The primary site for the I<zlib> compression library is
2271
+ L<http://www.zlib.org>.
2272
+
2273
+ The primary site for the I<zlib-ng> compression library is
2274
+ L<https://github.com/zlib-ng/zlib-ng>.
2275
+
2276
+ The primary site for gzip is L<http://www.gzip.org>.
2277
+
2278
+ =head1 AUTHOR
2279
+
2280
+ This module was written by Paul Marquess, C<pmqs@cpan.org>.
2281
+
2282
+ =head1 MODIFICATION HISTORY
2283
+
2284
+ See the Changes file.
2285
+
2286
+ =head1 COPYRIGHT AND LICENSE
2287
+
2288
+ Copyright (c) 2005-2024 Paul Marquess. All rights reserved.
2289
+
2290
+ This program is free software; you can redistribute it and/or
2291
+ modify it under the same terms as Perl itself.
git/usr/share/perl5/core_perl/IO/Socket/IP.pm ADDED
@@ -0,0 +1,1293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # You may distribute under the terms of either the GNU General Public License
2
+ # or the Artistic License (the same terms as Perl itself)
3
+ #
4
+ # (C) Paul Evans, 2010-2024 -- leonerd@leonerd.org.uk
5
+
6
+ package IO::Socket::IP 0.43;
7
+
8
+ use v5.14;
9
+ use warnings;
10
+
11
+ use base qw( IO::Socket );
12
+
13
+ use Carp;
14
+
15
+ use Socket 1.97 qw(
16
+ getaddrinfo getnameinfo
17
+ sockaddr_family
18
+ AF_INET
19
+ AI_PASSIVE
20
+ IPPROTO_TCP IPPROTO_UDP
21
+ IPPROTO_IPV6 IPV6_V6ONLY
22
+ NI_DGRAM NI_NUMERICHOST NI_NUMERICSERV NIx_NOHOST NIx_NOSERV
23
+ SO_REUSEADDR SO_REUSEPORT SO_BROADCAST SO_ERROR
24
+ SOCK_DGRAM SOCK_STREAM
25
+ SOL_SOCKET
26
+ );
27
+ my $AF_INET6 = eval { Socket::AF_INET6() }; # may not be defined
28
+ my $AI_ADDRCONFIG = eval { Socket::AI_ADDRCONFIG() } || 0;
29
+ use POSIX qw( dup2 );
30
+ use Errno qw( EINVAL EINPROGRESS EISCONN ENOTCONN ETIMEDOUT EWOULDBLOCK EOPNOTSUPP );
31
+
32
+ use constant HAVE_MSWIN32 => ( $^O eq "MSWin32" );
33
+
34
+ # At least one OS (Android) is known not to have getprotobyname()
35
+ use constant HAVE_GETPROTOBYNAME => defined eval { getprotobyname( "tcp" ) };
36
+
37
+ my $IPv6_re = do {
38
+ # translation of RFC 3986 3.2.2 ABNF to re
39
+ my $IPv4address = do {
40
+ my $dec_octet = q<(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])>;
41
+ qq<$dec_octet(?: \\. $dec_octet){3}>;
42
+ };
43
+ my $IPv6address = do {
44
+ my $h16 = qq<[0-9A-Fa-f]{1,4}>;
45
+ my $ls32 = qq<(?: $h16 : $h16 | $IPv4address)>;
46
+ qq<(?:
47
+ (?: $h16 : ){6} $ls32
48
+ | :: (?: $h16 : ){5} $ls32
49
+ | (?: $h16 )? :: (?: $h16 : ){4} $ls32
50
+ | (?: (?: $h16 : ){0,1} $h16 )? :: (?: $h16 : ){3} $ls32
51
+ | (?: (?: $h16 : ){0,2} $h16 )? :: (?: $h16 : ){2} $ls32
52
+ | (?: (?: $h16 : ){0,3} $h16 )? :: $h16 : $ls32
53
+ | (?: (?: $h16 : ){0,4} $h16 )? :: $ls32
54
+ | (?: (?: $h16 : ){0,5} $h16 )? :: $h16
55
+ | (?: (?: $h16 : ){0,6} $h16 )? ::
56
+ )>
57
+ };
58
+ qr<$IPv6address>xo;
59
+ };
60
+
61
+ =head1 NAME
62
+
63
+ C<IO::Socket::IP> - Family-neutral IP socket supporting both IPv4 and IPv6
64
+
65
+ =head1 SYNOPSIS
66
+
67
+ =for highlighter language=perl
68
+
69
+ use IO::Socket::IP;
70
+
71
+ my $sock = IO::Socket::IP->new(
72
+ PeerHost => "www.google.com",
73
+ PeerPort => "http",
74
+ Type => SOCK_STREAM,
75
+ ) or die "Cannot construct socket - $IO::Socket::errstr";
76
+
77
+ my $familyname = ( $sock->sockdomain == PF_INET6 ) ? "IPv6" :
78
+ ( $sock->sockdomain == PF_INET ) ? "IPv4" :
79
+ "unknown";
80
+
81
+ printf "Connected to google via %s\n", $familyname;
82
+
83
+ =head1 DESCRIPTION
84
+
85
+ This module provides a protocol-independent way to use IPv4 and IPv6 sockets,
86
+ intended as a replacement for L<IO::Socket::INET>. Most constructor arguments
87
+ and methods are provided in a backward-compatible way. For a list of known
88
+ differences, see the C<IO::Socket::INET> INCOMPATIBILITIES section below.
89
+
90
+ It uses the C<getaddrinfo(3)> function to convert hostnames and service names
91
+ or port numbers into sets of possible addresses to connect to or listen on.
92
+ This allows it to work for IPv6 where the system supports it, while still
93
+ falling back to IPv4-only on systems which don't.
94
+
95
+ =head1 REPLACING C<IO::Socket> DEFAULT BEHAVIOUR
96
+
97
+ By placing C<-register> in the import list to C<IO::Socket::IP>, it will
98
+ register itself with L<IO::Socket> as the class that handles C<PF_INET>. It
99
+ will also ask to handle C<PF_INET6> as well, provided that constant is
100
+ available.
101
+
102
+ Changing C<IO::Socket>'s default behaviour means that calling the
103
+ C<IO::Socket> constructor with either C<PF_INET> or C<PF_INET6> as the
104
+ C<Domain> parameter will yield an C<IO::Socket::IP> object.
105
+
106
+ use IO::Socket::IP -register;
107
+
108
+ my $sock = IO::Socket->new(
109
+ Domain => PF_INET6,
110
+ LocalHost => "::1",
111
+ Listen => 1,
112
+ ) or die "Cannot create socket - $IO::Socket::errstr\n";
113
+
114
+ print "Created a socket of type " . ref($sock) . "\n";
115
+
116
+ Note that C<-register> is a global setting that applies to the entire program;
117
+ it cannot be applied only for certain callers, removed, or limited by lexical
118
+ scope.
119
+
120
+ =cut
121
+
122
+ sub import
123
+ {
124
+ my $pkg = shift;
125
+ my @symbols;
126
+
127
+ foreach ( @_ ) {
128
+ if( $_ eq "-register" ) {
129
+ IO::Socket::IP::_ForINET->register_domain( AF_INET );
130
+ IO::Socket::IP::_ForINET6->register_domain( $AF_INET6 ) if defined $AF_INET6;
131
+ }
132
+ else {
133
+ push @symbols, $_;
134
+ }
135
+ }
136
+
137
+ @_ = ( $pkg, @symbols );
138
+ goto &IO::Socket::import;
139
+ }
140
+
141
+ # Convenient capability test function
142
+ {
143
+ my $can_disable_v6only;
144
+ sub CAN_DISABLE_V6ONLY
145
+ {
146
+ return $can_disable_v6only if defined $can_disable_v6only;
147
+
148
+ socket my $testsock, Socket::PF_INET6(), SOCK_STREAM, 0 or
149
+ die "Cannot socket(PF_INET6) - $!";
150
+
151
+ if( setsockopt $testsock, IPPROTO_IPV6, IPV6_V6ONLY, 0 ) {
152
+ if( $^O eq "dragonfly") {
153
+ # dragonflybsd 6.4 lies about successfully turning this off
154
+ if( getsockopt $testsock, IPPROTO_IPV6, IPV6_V6ONLY ) {
155
+ return $can_disable_v6only = 0;
156
+ }
157
+ }
158
+ return $can_disable_v6only = 1;
159
+ }
160
+ elsif( $! == EINVAL || $! == EOPNOTSUPP ) {
161
+ return $can_disable_v6only = 0;
162
+ }
163
+ else {
164
+ die "Cannot setsockopt() - $!";
165
+ }
166
+ }
167
+ }
168
+
169
+ =head1 CONSTRUCTORS
170
+
171
+ =cut
172
+
173
+ =head2 new
174
+
175
+ $sock = IO::Socket::IP->new( %args )
176
+
177
+ Creates a new C<IO::Socket::IP> object, containing a newly created socket
178
+ handle according to the named arguments passed. The recognised arguments are:
179
+
180
+ =over 8
181
+
182
+ =item PeerHost => STRING
183
+
184
+ =item PeerService => STRING
185
+
186
+ Hostname and service name for the peer to C<connect()> to. The service name
187
+ may be given as a port number, as a decimal string.
188
+
189
+ =item PeerAddr => STRING
190
+
191
+ =item PeerPort => STRING
192
+
193
+ For symmetry with the accessor methods and compatibility with
194
+ C<IO::Socket::INET>, these are accepted as synonyms for C<PeerHost> and
195
+ C<PeerService> respectively.
196
+
197
+ =item PeerAddrInfo => ARRAY
198
+
199
+ Alternate form of specifying the peer to C<connect()> to. This should be an
200
+ array of the form returned by C<Socket::getaddrinfo>.
201
+
202
+ This parameter takes precedence over the C<Peer*>, C<Family>, C<Type> and
203
+ C<Proto> arguments.
204
+
205
+ =item LocalHost => STRING
206
+
207
+ =item LocalService => STRING
208
+
209
+ Hostname and service name for the local address to C<bind()> to.
210
+
211
+ =item LocalAddr => STRING
212
+
213
+ =item LocalPort => STRING
214
+
215
+ For symmetry with the accessor methods and compatibility with
216
+ C<IO::Socket::INET>, these are accepted as synonyms for C<LocalHost> and
217
+ C<LocalService> respectively.
218
+
219
+ =item LocalAddrInfo => ARRAY
220
+
221
+ Alternate form of specifying the local address to C<bind()> to. This should be
222
+ an array of the form returned by C<Socket::getaddrinfo>.
223
+
224
+ This parameter takes precedence over the C<Local*>, C<Family>, C<Type> and
225
+ C<Proto> arguments.
226
+
227
+ =item Family => INT
228
+
229
+ The address family to pass to C<getaddrinfo> (e.g. C<AF_INET>, C<AF_INET6>).
230
+ Normally this will be left undefined, and C<getaddrinfo> will search using any
231
+ address family supported by the system.
232
+
233
+ =item Type => INT
234
+
235
+ The socket type to pass to C<getaddrinfo> (e.g. C<SOCK_STREAM>,
236
+ C<SOCK_DGRAM>). Normally defined by the caller; if left undefined
237
+ C<getaddrinfo> may attempt to infer the type from the service name.
238
+
239
+ =item Proto => STRING or INT
240
+
241
+ The IP protocol to use for the socket (e.g. C<'tcp'>, C<IPPROTO_TCP>,
242
+ C<'udp'>,C<IPPROTO_UDP>). Normally this will be left undefined, and either
243
+ C<getaddrinfo> or the kernel will choose an appropriate value. May be given
244
+ either in string name or numeric form.
245
+
246
+ =item GetAddrInfoFlags => INT
247
+
248
+ More flags to pass to the C<getaddrinfo()> function. If not supplied, a
249
+ default of C<AI_ADDRCONFIG> will be used.
250
+
251
+ These flags will be combined with C<AI_PASSIVE> if the C<Listen> argument is
252
+ given. For more information see the documentation about C<getaddrinfo()> in
253
+ the L<Socket> module.
254
+
255
+ =item Listen => INT
256
+
257
+ If defined, puts the socket into listening mode where new connections can be
258
+ accepted using the C<accept> method. The value given is used as the
259
+ C<listen(2)> queue size.
260
+
261
+ =item ReuseAddr => BOOL
262
+
263
+ If true, set the C<SO_REUSEADDR> sockopt
264
+
265
+ =item ReusePort => BOOL
266
+
267
+ If true, set the C<SO_REUSEPORT> sockopt (not all OSes implement this sockopt)
268
+
269
+ =item Broadcast => BOOL
270
+
271
+ If true, set the C<SO_BROADCAST> sockopt
272
+
273
+ =item Sockopts => ARRAY
274
+
275
+ An optional array of other socket options to apply after the three listed
276
+ above. The value is an ARRAY containing 2- or 3-element ARRAYrefs. Each inner
277
+ array relates to a single option, giving the level and option name, and an
278
+ optional value. If the value element is missing, it will be given the value of
279
+ a platform-sized integer 1 constant (i.e. suitable to enable most of the
280
+ common boolean options).
281
+
282
+ For example, both options given below are equivalent to setting C<ReuseAddr>.
283
+
284
+ Sockopts => [
285
+ [ SOL_SOCKET, SO_REUSEADDR ],
286
+ [ SOL_SOCKET, SO_REUSEADDR, pack( "i", 1 ) ],
287
+ ]
288
+
289
+ =item V6Only => BOOL
290
+
291
+ If defined, set the C<IPV6_V6ONLY> sockopt when creating C<PF_INET6> sockets
292
+ to the given value. If true, a listening-mode socket will only listen on the
293
+ C<AF_INET6> addresses; if false it will also accept connections from
294
+ C<AF_INET> addresses.
295
+
296
+ If not defined, the socket option will not be changed, and default value set
297
+ by the operating system will apply. For repeatable behaviour across platforms
298
+ it is recommended this value always be defined for listening-mode sockets.
299
+
300
+ Note that not all platforms support disabling this option. Some, at least
301
+ OpenBSD and MirBSD, will fail with C<EINVAL> if you attempt to disable it.
302
+ To determine whether it is possible to disable, you may use the class method
303
+
304
+ if( IO::Socket::IP->CAN_DISABLE_V6ONLY ) {
305
+ ...
306
+ }
307
+ else {
308
+ ...
309
+ }
310
+
311
+ If your platform does not support disabling this option but you still want to
312
+ listen for both C<AF_INET> and C<AF_INET6> connections you will have to create
313
+ two listening sockets, one bound to each protocol.
314
+
315
+ =item MultiHomed
316
+
317
+ This C<IO::Socket::INET>-style argument is ignored, except if it is defined
318
+ but false. See the C<IO::Socket::INET> INCOMPATIBILITIES section below.
319
+
320
+ However, the behaviour it enables is always performed by C<IO::Socket::IP>.
321
+
322
+ =item Blocking => BOOL
323
+
324
+ If defined but false, the socket will be set to non-blocking mode. Otherwise
325
+ it will default to blocking mode. See the NON-BLOCKING section below for more
326
+ detail.
327
+
328
+ =item Timeout => NUM
329
+
330
+ If defined, gives a maximum time in seconds to block per C<connect()> call
331
+ when in blocking mode. If missing, no timeout is applied other than that
332
+ provided by the underlying operating system. When in non-blocking mode this
333
+ parameter is ignored.
334
+
335
+ Note that if the hostname resolves to multiple address candidates, the same
336
+ timeout will apply to each connection attempt individually, rather than to the
337
+ operation as a whole. Further note that the timeout does not apply to the
338
+ initial hostname resolve operation, if connecting by hostname.
339
+
340
+ This behaviour is copied inspired by C<IO::Socket::INET>; for more fine
341
+ grained control over connection timeouts, consider performing a nonblocking
342
+ connect directly.
343
+
344
+ =back
345
+
346
+ If neither C<Type> nor C<Proto> hints are provided, a default of
347
+ C<SOCK_STREAM> and C<IPPROTO_TCP> respectively will be set, to maintain
348
+ compatibility with C<IO::Socket::INET>. Other named arguments that are not
349
+ recognised are ignored.
350
+
351
+ If neither C<Family> nor any hosts or addresses are passed, nor any
352
+ C<*AddrInfo>, then the constructor has no information on which to decide a
353
+ socket family to create. In this case, it performs a C<getaddrinfo> call with
354
+ the C<AI_ADDRCONFIG> flag, no host name, and a service name of C<"0">, and
355
+ uses the family of the first returned result.
356
+
357
+ If the constructor fails, it will set C<$IO::Socket::errstr> and C<$@> to
358
+ an appropriate error message; this may be from C<$!> or it may be some other
359
+ string; not every failure necessarily has an associated C<errno> value.
360
+
361
+ =head2 new (one arg)
362
+
363
+ $sock = IO::Socket::IP->new( $peeraddr )
364
+
365
+ As a special case, if the constructor is passed a single argument (as
366
+ opposed to an even-sized list of key/value pairs), it is taken to be the value
367
+ of the C<PeerAddr> parameter. This is parsed in the same way, according to the
368
+ behaviour given in the C<PeerHost> AND C<LocalHost> PARSING section below.
369
+
370
+ =cut
371
+
372
+ sub new
373
+ {
374
+ my $class = shift;
375
+ my %arg = (@_ == 1) ? (PeerHost => $_[0]) : @_;
376
+ return $class->SUPER::new(%arg);
377
+ }
378
+
379
+ # IO::Socket may call this one; neaten up the arguments from IO::Socket::INET
380
+ # before calling our real _configure method
381
+ sub configure
382
+ {
383
+ my $self = shift;
384
+ my ( $arg ) = @_;
385
+
386
+ $arg->{PeerHost} = delete $arg->{PeerAddr}
387
+ if exists $arg->{PeerAddr} && !exists $arg->{PeerHost};
388
+
389
+ $arg->{PeerService} = delete $arg->{PeerPort}
390
+ if exists $arg->{PeerPort} && !exists $arg->{PeerService};
391
+
392
+ $arg->{LocalHost} = delete $arg->{LocalAddr}
393
+ if exists $arg->{LocalAddr} && !exists $arg->{LocalHost};
394
+
395
+ $arg->{LocalService} = delete $arg->{LocalPort}
396
+ if exists $arg->{LocalPort} && !exists $arg->{LocalService};
397
+
398
+ for my $type (qw(Peer Local)) {
399
+ my $host = $type . 'Host';
400
+ my $service = $type . 'Service';
401
+
402
+ if( defined $arg->{$host} ) {
403
+ ( $arg->{$host}, my $s ) = $self->split_addr( $arg->{$host} );
404
+ # IO::Socket::INET compat - *Host parsed port always takes precedence
405
+ $arg->{$service} = $s if defined $s;
406
+ }
407
+ }
408
+
409
+ $self->_io_socket_ip__configure( $arg );
410
+ }
411
+
412
+ # Avoid simply calling it _configure, as some subclasses of IO::Socket::INET on CPAN already take that
413
+ sub _io_socket_ip__configure
414
+ {
415
+ my $self = shift;
416
+ my ( $arg ) = @_;
417
+
418
+ my %hints;
419
+ my @localinfos;
420
+ my @peerinfos;
421
+
422
+ my $listenqueue = $arg->{Listen};
423
+ if( defined $listenqueue and
424
+ ( defined $arg->{PeerHost} || defined $arg->{PeerService} || defined $arg->{PeerAddrInfo} ) ) {
425
+ croak "Cannot Listen with a peer address";
426
+ }
427
+
428
+ if( defined $arg->{GetAddrInfoFlags} ) {
429
+ $hints{flags} = $arg->{GetAddrInfoFlags};
430
+ }
431
+ else {
432
+ $hints{flags} = $AI_ADDRCONFIG;
433
+ }
434
+
435
+ if( defined( my $family = $arg->{Family} ) ) {
436
+ $hints{family} = $family;
437
+ }
438
+
439
+ if( defined( my $type = $arg->{Type} ) ) {
440
+ $hints{socktype} = $type;
441
+ }
442
+
443
+ if( defined( my $proto = $arg->{Proto} ) ) {
444
+ unless( $proto =~ m/^\d+$/ ) {
445
+ my $protonum = HAVE_GETPROTOBYNAME
446
+ ? getprotobyname( $proto )
447
+ : eval { Socket->${\"IPPROTO_\U$proto"}() };
448
+ defined $protonum or croak "Unrecognised protocol $proto";
449
+ $proto = $protonum;
450
+ }
451
+
452
+ $hints{protocol} = $proto;
453
+ }
454
+
455
+ # To maintain compatibility with IO::Socket::INET, imply a default of
456
+ # SOCK_STREAM + IPPROTO_TCP if neither hint is given
457
+ if( !defined $hints{socktype} and !defined $hints{protocol} ) {
458
+ $hints{socktype} = SOCK_STREAM;
459
+ $hints{protocol} = IPPROTO_TCP;
460
+ }
461
+
462
+ # Some OSes (NetBSD) don't seem to like just a protocol hint without a
463
+ # socktype hint as well. We'll set a couple of common ones
464
+ if( !defined $hints{socktype} and defined $hints{protocol} ) {
465
+ $hints{socktype} = SOCK_STREAM if $hints{protocol} == IPPROTO_TCP;
466
+ $hints{socktype} = SOCK_DGRAM if $hints{protocol} == IPPROTO_UDP;
467
+ }
468
+
469
+ if( my $info = $arg->{LocalAddrInfo} ) {
470
+ ref $info eq "ARRAY" or croak "Expected 'LocalAddrInfo' to be an ARRAY ref";
471
+ @localinfos = @$info;
472
+ }
473
+ elsif( defined $arg->{LocalHost} or
474
+ defined $arg->{LocalService} or
475
+ HAVE_MSWIN32 and $arg->{Listen} ) {
476
+ # Either may be undef
477
+ my $host = $arg->{LocalHost};
478
+ my $service = $arg->{LocalService};
479
+
480
+ unless ( defined $host or defined $service ) {
481
+ $service = 0;
482
+ }
483
+
484
+ local $1; # Placate a taint-related bug; [perl #67962]
485
+ defined $service and $service =~ s/\((\d+)\)$// and
486
+ my $fallback_port = $1;
487
+
488
+ my %localhints = %hints;
489
+ $localhints{flags} |= AI_PASSIVE;
490
+ ( my $err, @localinfos ) = getaddrinfo( $host, $service, \%localhints );
491
+
492
+ if( $err and defined $fallback_port ) {
493
+ ( $err, @localinfos ) = getaddrinfo( $host, $fallback_port, \%localhints );
494
+ }
495
+
496
+ if( $err ) {
497
+ $IO::Socket::errstr = $@ = "$err";
498
+ $! = EINVAL;
499
+ return;
500
+ }
501
+ }
502
+
503
+ if( my $info = $arg->{PeerAddrInfo} ) {
504
+ ref $info eq "ARRAY" or croak "Expected 'PeerAddrInfo' to be an ARRAY ref";
505
+ @peerinfos = @$info;
506
+ }
507
+ elsif( defined $arg->{PeerHost} or defined $arg->{PeerService} ) {
508
+ defined( my $host = $arg->{PeerHost} ) or
509
+ croak "Expected 'PeerHost'";
510
+ defined( my $service = $arg->{PeerService} ) or
511
+ croak "Expected 'PeerService'";
512
+
513
+ local $1; # Placate a taint-related bug; [perl #67962]
514
+ defined $service and $service =~ s/\((\d+)\)$// and
515
+ my $fallback_port = $1;
516
+
517
+ ( my $err, @peerinfos ) = getaddrinfo( $host, $service, \%hints );
518
+
519
+ if( $err and defined $fallback_port ) {
520
+ ( $err, @peerinfos ) = getaddrinfo( $host, $fallback_port, \%hints );
521
+ }
522
+
523
+ if( $err ) {
524
+ $IO::Socket::errstr = $@ = "$err";
525
+ $! = EINVAL;
526
+ return;
527
+ }
528
+ }
529
+
530
+ my $INT_1 = pack "i", 1;
531
+
532
+ my @sockopts_enabled;
533
+ push @sockopts_enabled, [ SOL_SOCKET, SO_REUSEADDR, $INT_1 ] if $arg->{ReuseAddr};
534
+ push @sockopts_enabled, [ SOL_SOCKET, SO_REUSEPORT, $INT_1 ] if $arg->{ReusePort};
535
+ push @sockopts_enabled, [ SOL_SOCKET, SO_BROADCAST, $INT_1 ] if $arg->{Broadcast};
536
+
537
+ if( my $sockopts = $arg->{Sockopts} ) {
538
+ ref $sockopts eq "ARRAY" or croak "Expected 'Sockopts' to be an ARRAY ref";
539
+ foreach ( @$sockopts ) {
540
+ ref $_ eq "ARRAY" or croak "Bad Sockopts item - expected ARRAYref";
541
+ @$_ >= 2 and @$_ <= 3 or
542
+ croak "Bad Sockopts item - expected 2 or 3 elements";
543
+
544
+ my ( $level, $optname, $value ) = @$_;
545
+ # TODO: consider more sanity checking on argument values
546
+
547
+ defined $value or $value = $INT_1;
548
+ push @sockopts_enabled, [ $level, $optname, $value ];
549
+ }
550
+ }
551
+
552
+ my $blocking = $arg->{Blocking};
553
+ defined $blocking or $blocking = 1;
554
+
555
+ my $v6only = $arg->{V6Only};
556
+
557
+ # IO::Socket::INET defines this key. IO::Socket::IP always implements the
558
+ # behaviour it requests, so we can ignore it, unless the caller is for some
559
+ # reason asking to disable it.
560
+ if( defined $arg->{MultiHomed} and !$arg->{MultiHomed} ) {
561
+ croak "Cannot disable the MultiHomed parameter";
562
+ }
563
+
564
+ my @infos;
565
+ foreach my $local ( @localinfos ? @localinfos : {} ) {
566
+ foreach my $peer ( @peerinfos ? @peerinfos : {} ) {
567
+ next if defined $local->{family} and defined $peer->{family} and
568
+ $local->{family} != $peer->{family};
569
+ next if defined $local->{socktype} and defined $peer->{socktype} and
570
+ $local->{socktype} != $peer->{socktype};
571
+ next if defined $local->{protocol} and defined $peer->{protocol} and
572
+ $local->{protocol} != $peer->{protocol};
573
+
574
+ my $family = $local->{family} || $peer->{family} or next;
575
+ my $socktype = $local->{socktype} || $peer->{socktype} or next;
576
+ my $protocol = $local->{protocol} || $peer->{protocol} || 0;
577
+
578
+ push @infos, {
579
+ family => $family,
580
+ socktype => $socktype,
581
+ protocol => $protocol,
582
+ localaddr => $local->{addr},
583
+ peeraddr => $peer->{addr},
584
+ };
585
+ }
586
+ }
587
+
588
+ if( !@infos ) {
589
+ # If there was a Family hint then create a plain unbound, unconnected socket
590
+ if( defined $hints{family} ) {
591
+ @infos = ( {
592
+ family => $hints{family},
593
+ socktype => $hints{socktype},
594
+ protocol => $hints{protocol},
595
+ } );
596
+ }
597
+ # If there wasn't, use getaddrinfo()'s AI_ADDRCONFIG side-effect to guess a
598
+ # suitable family first.
599
+ else {
600
+ ( my $err, @infos ) = getaddrinfo( "", "0", \%hints );
601
+ if( $err ) {
602
+ $IO::Socket::errstr = $@ = "$err";
603
+ $! = EINVAL;
604
+ return;
605
+ }
606
+
607
+ # We'll take all the @infos anyway, because some OSes (HPUX) are known to
608
+ # ignore the AI_ADDRCONFIG hint and return AF_INET6 even if they don't
609
+ # support them
610
+ }
611
+ }
612
+
613
+ # In the nonblocking case, caller will be calling ->setup multiple times.
614
+ # Store configuration in the object for the ->setup method
615
+ # Yes, these are messy. Sorry, I can't help that...
616
+
617
+ ${*$self}{io_socket_ip_infos} = \@infos;
618
+
619
+ ${*$self}{io_socket_ip_idx} = -1;
620
+
621
+ ${*$self}{io_socket_ip_sockopts} = \@sockopts_enabled;
622
+ ${*$self}{io_socket_ip_v6only} = $v6only;
623
+ ${*$self}{io_socket_ip_listenqueue} = $listenqueue;
624
+ ${*$self}{io_socket_ip_blocking} = $blocking;
625
+
626
+ ${*$self}{io_socket_ip_errors} = [ undef, undef, undef ];
627
+
628
+ # ->setup is allowed to return false in nonblocking mode
629
+ $self->setup or !$blocking or return undef;
630
+
631
+ return $self;
632
+ }
633
+
634
+ sub setup
635
+ {
636
+ my $self = shift;
637
+
638
+ while(1) {
639
+ ${*$self}{io_socket_ip_idx}++;
640
+ last if ${*$self}{io_socket_ip_idx} >= @{ ${*$self}{io_socket_ip_infos} };
641
+
642
+ my $info = ${*$self}{io_socket_ip_infos}->[${*$self}{io_socket_ip_idx}];
643
+
644
+ $self->socket( @{$info}{qw( family socktype protocol )} ) or
645
+ ( ${*$self}{io_socket_ip_errors}[2] = $!, next );
646
+
647
+ $self->blocking( 0 ) unless ${*$self}{io_socket_ip_blocking};
648
+
649
+ foreach my $sockopt ( @{ ${*$self}{io_socket_ip_sockopts} } ) {
650
+ my ( $level, $optname, $value ) = @$sockopt;
651
+ $self->setsockopt( $level, $optname, $value ) or
652
+ ( $IO::Socket::errstr = $@ = "$!", return undef );
653
+ }
654
+
655
+ if( defined ${*$self}{io_socket_ip_v6only} and defined $AF_INET6 and $info->{family} == $AF_INET6 ) {
656
+ my $v6only = ${*$self}{io_socket_ip_v6only};
657
+ $self->setsockopt( IPPROTO_IPV6, IPV6_V6ONLY, pack "i", $v6only ) or
658
+ ( $IO::Socket::errstr = $@ = "$!", return undef );
659
+ }
660
+
661
+ if( defined( my $addr = $info->{localaddr} ) ) {
662
+ $self->bind( $addr ) or
663
+ ( ${*$self}{io_socket_ip_errors}[1] = $!, next );
664
+ }
665
+
666
+ if( defined( my $listenqueue = ${*$self}{io_socket_ip_listenqueue} ) ) {
667
+ $self->listen( $listenqueue ) or
668
+ ( $IO::Socket::errstr = $@ = "$!", return undef );
669
+ }
670
+
671
+ if( defined( my $addr = $info->{peeraddr} ) ) {
672
+ if( $self->connect( $addr ) ) {
673
+ $! = 0;
674
+ return 1;
675
+ }
676
+
677
+ if( $! == EINPROGRESS or $! == EWOULDBLOCK ) {
678
+ ${*$self}{io_socket_ip_connect_in_progress} = 1;
679
+ return 0;
680
+ }
681
+
682
+ # If connect failed but we have no system error there must be an error
683
+ # at the application layer, like a bad certificate with
684
+ # IO::Socket::SSL.
685
+ # In this case don't continue IP based multi-homing because the problem
686
+ # cannot be solved at the IP layer.
687
+ return 0 if ! $!;
688
+
689
+ ${*$self}{io_socket_ip_errors}[0] = $!;
690
+ next;
691
+ }
692
+
693
+ return 1;
694
+ }
695
+
696
+ # Pick the most appropriate error, stringified
697
+ $! = ( grep defined, @{ ${*$self}{io_socket_ip_errors}} )[0];
698
+ $IO::Socket::errstr = $@ = "$!";
699
+ return undef;
700
+ }
701
+
702
+ sub connect :method
703
+ {
704
+ my $self = shift;
705
+
706
+ # It seems that IO::Socket hides EINPROGRESS errors, making them look like
707
+ # a success. This is annoying here.
708
+ # Instead of putting up with its frankly-irritating intentional breakage of
709
+ # useful APIs I'm just going to end-run around it and call core's connect()
710
+ # directly
711
+
712
+ if( @_ ) {
713
+ my ( $addr ) = @_;
714
+
715
+ # Annoyingly IO::Socket's connect() is where the timeout logic is
716
+ # implemented, so we'll have to reinvent it here
717
+ my $timeout = ${*$self}{'io_socket_timeout'};
718
+
719
+ return connect( $self, $addr ) unless defined $timeout;
720
+
721
+ my $was_blocking = $self->blocking( 0 );
722
+
723
+ my $err = defined connect( $self, $addr ) ? 0 : $!+0;
724
+
725
+ if( !$err ) {
726
+ # All happy
727
+ $self->blocking( $was_blocking );
728
+ return 1;
729
+ }
730
+ elsif( not( $err == EINPROGRESS or $err == EWOULDBLOCK ) ) {
731
+ # Failed for some other reason
732
+ $self->blocking( $was_blocking );
733
+ return undef;
734
+ }
735
+ elsif( !$was_blocking ) {
736
+ # We shouldn't block anyway
737
+ return undef;
738
+ }
739
+
740
+ my $vec = ''; vec( $vec, $self->fileno, 1 ) = 1;
741
+ if( !select( undef, $vec, $vec, $timeout ) ) {
742
+ $self->blocking( $was_blocking );
743
+ $! = ETIMEDOUT;
744
+ return undef;
745
+ }
746
+
747
+ # Hoist the error by connect()ing a second time
748
+ $err = $self->getsockopt( SOL_SOCKET, SO_ERROR );
749
+ $err = 0 if $err == EISCONN; # Some OSes give EISCONN
750
+
751
+ $self->blocking( $was_blocking );
752
+
753
+ $! = $err, return undef if $err;
754
+ return 1;
755
+ }
756
+
757
+ return 1 if !${*$self}{io_socket_ip_connect_in_progress};
758
+
759
+ # See if a connect attempt has just failed with an error
760
+ if( my $errno = $self->getsockopt( SOL_SOCKET, SO_ERROR ) ) {
761
+ delete ${*$self}{io_socket_ip_connect_in_progress};
762
+ ${*$self}{io_socket_ip_errors}[0] = $! = $errno;
763
+ return $self->setup;
764
+ }
765
+
766
+ # No error, so either connect is still in progress, or has completed
767
+ # successfully. We can tell by trying to connect() again; either it will
768
+ # succeed or we'll get EISCONN (connected successfully), or EALREADY
769
+ # (still in progress). This even works on MSWin32.
770
+ my $addr = ${*$self}{io_socket_ip_infos}[${*$self}{io_socket_ip_idx}]{peeraddr};
771
+
772
+ if( connect( $self, $addr ) or $! == EISCONN ) {
773
+ delete ${*$self}{io_socket_ip_connect_in_progress};
774
+ $! = 0;
775
+ return 1;
776
+ }
777
+ else {
778
+ $! = EINPROGRESS;
779
+ return 0;
780
+ }
781
+ }
782
+
783
+ sub connected
784
+ {
785
+ my $self = shift;
786
+ return defined $self->fileno &&
787
+ !${*$self}{io_socket_ip_connect_in_progress} &&
788
+ defined getpeername( $self ); # ->peername caches, we need to detect disconnection
789
+ }
790
+
791
+ =head1 METHODS
792
+
793
+ As well as the following methods, this class inherits all the methods in
794
+ L<IO::Socket> and L<IO::Handle>.
795
+
796
+ =cut
797
+
798
+ sub _get_host_service
799
+ {
800
+ my $self = shift;
801
+ my ( $addr, $flags, $xflags ) = @_;
802
+
803
+ defined $addr or
804
+ $! = ENOTCONN, return;
805
+
806
+ $flags |= NI_DGRAM if $self->socktype == SOCK_DGRAM;
807
+
808
+ my ( $err, $host, $service ) = getnameinfo( $addr, $flags, $xflags || 0 );
809
+ croak "getnameinfo - $err" if $err;
810
+
811
+ return ( $host, $service );
812
+ }
813
+
814
+ sub _unpack_sockaddr
815
+ {
816
+ my ( $addr ) = @_;
817
+ my $family = sockaddr_family $addr;
818
+
819
+ if( $family == AF_INET ) {
820
+ return ( Socket::unpack_sockaddr_in( $addr ) )[1];
821
+ }
822
+ elsif( defined $AF_INET6 and $family == $AF_INET6 ) {
823
+ return ( Socket::unpack_sockaddr_in6( $addr ) )[1];
824
+ }
825
+ else {
826
+ croak "Unrecognised address family $family";
827
+ }
828
+ }
829
+
830
+ =head2 sockhost_service
831
+
832
+ ( $host, $service ) = $sock->sockhost_service( $numeric );
833
+
834
+ Returns the hostname and service name of the local address (that is, the
835
+ socket address given by the C<sockname> method).
836
+
837
+ If C<$numeric> is true, these will be given in numeric form rather than being
838
+ resolved into names.
839
+
840
+ The following four convenience wrappers may be used to obtain one of the two
841
+ values returned here. If both host and service names are required, this method
842
+ is preferable to the following wrappers, because it will call
843
+ C<getnameinfo(3)> only once.
844
+
845
+ =cut
846
+
847
+ sub sockhost_service
848
+ {
849
+ my $self = shift;
850
+ my ( $numeric ) = @_;
851
+
852
+ $self->_get_host_service( $self->sockname, $numeric ? NI_NUMERICHOST|NI_NUMERICSERV : 0 );
853
+ }
854
+
855
+ =head2 sockhost
856
+
857
+ $addr = $sock->sockhost;
858
+
859
+ Return the numeric form of the local address as a textual representation
860
+
861
+ =head2 sockport
862
+
863
+ $port = $sock->sockport;
864
+
865
+ Return the numeric form of the local port number
866
+
867
+ =head2 sockhostname
868
+
869
+ $host = $sock->sockhostname;
870
+
871
+ Return the resolved name of the local address
872
+
873
+ =head2 sockservice
874
+
875
+ $service = $sock->sockservice;
876
+
877
+ Return the resolved name of the local port number
878
+
879
+ =cut
880
+
881
+ sub sockhost { my $self = shift; scalar +( $self->_get_host_service( $self->sockname, NI_NUMERICHOST, NIx_NOSERV ) )[0] }
882
+ sub sockport { my $self = shift; scalar +( $self->_get_host_service( $self->sockname, NI_NUMERICSERV, NIx_NOHOST ) )[1] }
883
+
884
+ sub sockhostname { my $self = shift; scalar +( $self->_get_host_service( $self->sockname, 0, NIx_NOSERV ) )[0] }
885
+ sub sockservice { my $self = shift; scalar +( $self->_get_host_service( $self->sockname, 0, NIx_NOHOST ) )[1] }
886
+
887
+ =head2 sockaddr
888
+
889
+ $addr = $sock->sockaddr;
890
+
891
+ Return the local address as a binary octet string
892
+
893
+ =cut
894
+
895
+ sub sockaddr { my $self = shift; _unpack_sockaddr $self->sockname }
896
+
897
+ =head2 peerhost_service
898
+
899
+ ( $host, $service ) = $sock->peerhost_service( $numeric );
900
+
901
+ Returns the hostname and service name of the peer address (that is, the
902
+ socket address given by the C<peername> method), similar to the
903
+ C<sockhost_service> method.
904
+
905
+ The following four convenience wrappers may be used to obtain one of the two
906
+ values returned here. If both host and service names are required, this method
907
+ is preferable to the following wrappers, because it will call
908
+ C<getnameinfo(3)> only once.
909
+
910
+ =cut
911
+
912
+ sub peerhost_service
913
+ {
914
+ my $self = shift;
915
+ my ( $numeric ) = @_;
916
+
917
+ $self->_get_host_service( $self->peername, $numeric ? NI_NUMERICHOST|NI_NUMERICSERV : 0 );
918
+ }
919
+
920
+ =head2 peerhost
921
+
922
+ $addr = $sock->peerhost;
923
+
924
+ Return the numeric form of the peer address as a textual representation
925
+
926
+ =head2 peerport
927
+
928
+ $port = $sock->peerport;
929
+
930
+ Return the numeric form of the peer port number
931
+
932
+ =head2 peerhostname
933
+
934
+ $host = $sock->peerhostname;
935
+
936
+ Return the resolved name of the peer address
937
+
938
+ =head2 peerservice
939
+
940
+ $service = $sock->peerservice;
941
+
942
+ Return the resolved name of the peer port number
943
+
944
+ =cut
945
+
946
+ sub peerhost { my $self = shift; scalar +( $self->_get_host_service( $self->peername, NI_NUMERICHOST, NIx_NOSERV ) )[0] }
947
+ sub peerport { my $self = shift; scalar +( $self->_get_host_service( $self->peername, NI_NUMERICSERV, NIx_NOHOST ) )[1] }
948
+
949
+ sub peerhostname { my $self = shift; scalar +( $self->_get_host_service( $self->peername, 0, NIx_NOSERV ) )[0] }
950
+ sub peerservice { my $self = shift; scalar +( $self->_get_host_service( $self->peername, 0, NIx_NOHOST ) )[1] }
951
+
952
+ =head2 peeraddr
953
+
954
+ $addr = $peer->peeraddr;
955
+
956
+ Return the peer address as a binary octet string
957
+
958
+ =cut
959
+
960
+ sub peeraddr { my $self = shift; _unpack_sockaddr $self->peername }
961
+
962
+ # This unbelievably dodgy hack works around the bug that IO::Socket doesn't do
963
+ # it
964
+ # https://rt.cpan.org/Ticket/Display.html?id=61577
965
+ sub accept
966
+ {
967
+ my $self = shift;
968
+ my ( $new, $peer ) = $self->SUPER::accept( @_ ) or return;
969
+
970
+ ${*$new}{$_} = ${*$self}{$_} for qw( io_socket_domain io_socket_type io_socket_proto );
971
+
972
+ return wantarray ? ( $new, $peer )
973
+ : $new;
974
+ }
975
+
976
+ # This second unbelievably dodgy hack guarantees that $self->fileno doesn't
977
+ # change, which is useful during nonblocking connect
978
+ sub socket :method
979
+ {
980
+ my $self = shift;
981
+ return $self->SUPER::socket(@_) if not defined $self->fileno;
982
+
983
+ # I hate core prototypes sometimes...
984
+ socket( my $tmph, $_[0], $_[1], $_[2] ) or return undef;
985
+
986
+ dup2( $tmph->fileno, $self->fileno ) or die "Unable to dup2 $tmph onto $self - $!";
987
+ }
988
+
989
+ # Versions of IO::Socket before 1.35 may leave socktype undef if from, say, an
990
+ # ->fdopen call. In this case we'll apply a fix
991
+ BEGIN {
992
+ if( eval($IO::Socket::VERSION) < 1.35 ) {
993
+ *socktype = sub {
994
+ my $self = shift;
995
+ my $type = $self->SUPER::socktype;
996
+ if( !defined $type ) {
997
+ $type = $self->sockopt( Socket::SO_TYPE() );
998
+ }
999
+ return $type;
1000
+ };
1001
+ }
1002
+ }
1003
+
1004
+ =head2 as_inet
1005
+
1006
+ $inet = $sock->as_inet;
1007
+
1008
+ Returns a new L<IO::Socket::INET> instance wrapping the same filehandle. This
1009
+ may be useful in cases where it is required, for backward-compatibility, to
1010
+ have a real object of C<IO::Socket::INET> type instead of C<IO::Socket::IP>.
1011
+ The new object will wrap the same underlying socket filehandle as the
1012
+ original, so care should be taken not to continue to use both objects
1013
+ concurrently. Ideally the original C<$sock> should be discarded after this
1014
+ method is called.
1015
+
1016
+ This method checks that the socket domain is C<PF_INET> and will throw an
1017
+ exception if it isn't.
1018
+
1019
+ =cut
1020
+
1021
+ sub as_inet
1022
+ {
1023
+ my $self = shift;
1024
+ croak "Cannot downgrade a non-PF_INET socket to IO::Socket::INET" unless $self->sockdomain == AF_INET;
1025
+ return IO::Socket::INET->new_from_fd( $self->fileno, "r+" );
1026
+ }
1027
+
1028
+ =head1 NON-BLOCKING
1029
+
1030
+ If the constructor is passed a defined but false value for the C<Blocking>
1031
+ argument then the socket is put into non-blocking mode. When in non-blocking
1032
+ mode, the socket will not be set up by the time the constructor returns,
1033
+ because the underlying C<connect(2)> syscall would otherwise have to block.
1034
+
1035
+ The non-blocking behaviour is an extension of the C<IO::Socket::INET> API,
1036
+ unique to C<IO::Socket::IP>, because the former does not support multi-homed
1037
+ non-blocking connect.
1038
+
1039
+ When using non-blocking mode, the caller must repeatedly check for
1040
+ writeability on the filehandle (for instance using C<select> or C<IO::Poll>).
1041
+ Each time the filehandle is ready to write, the C<connect> method must be
1042
+ called, with no arguments. Note that some operating systems, most notably
1043
+ C<MSWin32> do not report a C<connect()> failure using write-ready; so you must
1044
+ also C<select()> for exceptional status.
1045
+
1046
+ While C<connect> returns false, the value of C<$!> indicates whether it should
1047
+ be tried again (by being set to the value C<EINPROGRESS>, or C<EWOULDBLOCK> on
1048
+ MSWin32), or whether a permanent error has occurred (e.g. C<ECONNREFUSED>).
1049
+
1050
+ Once the socket has been connected to the peer, C<connect> will return true
1051
+ and the socket will now be ready to use.
1052
+
1053
+ Note that calls to the platform's underlying C<getaddrinfo(3)> function may
1054
+ block. If C<IO::Socket::IP> has to perform this lookup, the constructor will
1055
+ block even when in non-blocking mode.
1056
+
1057
+ To avoid this blocking behaviour, the caller should pass in the result of such
1058
+ a lookup using the C<PeerAddrInfo> or C<LocalAddrInfo> arguments. This can be
1059
+ achieved by using L<Net::LibAsyncNS>, or the C<getaddrinfo(3)> function can be
1060
+ called in a child process.
1061
+
1062
+ use IO::Socket::IP;
1063
+ use Errno qw( EINPROGRESS EWOULDBLOCK );
1064
+
1065
+ my @peeraddrinfo = ... # Caller must obtain the getaddrinfo result here
1066
+
1067
+ my $socket = IO::Socket::IP->new(
1068
+ PeerAddrInfo => \@peeraddrinfo,
1069
+ Blocking => 0,
1070
+ ) or die "Cannot construct socket - $@";
1071
+
1072
+ while( !$socket->connect and ( $! == EINPROGRESS || $! == EWOULDBLOCK ) ) {
1073
+ my $wvec = '';
1074
+ vec( $wvec, fileno $socket, 1 ) = 1;
1075
+ my $evec = '';
1076
+ vec( $evec, fileno $socket, 1 ) = 1;
1077
+
1078
+ select( undef, $wvec, $evec, undef ) or die "Cannot select - $!";
1079
+ }
1080
+
1081
+ die "Cannot connect - $!" if $!;
1082
+
1083
+ ...
1084
+
1085
+ The example above uses C<select()>, but any similar mechanism should work
1086
+ analogously. C<IO::Socket::IP> takes care when creating new socket filehandles
1087
+ to preserve the actual file descriptor number, so such techniques as C<poll>
1088
+ or C<epoll> should be transparent to its reallocation of a different socket
1089
+ underneath, perhaps in order to switch protocol family between C<PF_INET> and
1090
+ C<PF_INET6>.
1091
+
1092
+ For another example using C<IO::Poll> and C<Net::LibAsyncNS>, see the
1093
+ F<examples/nonblocking_libasyncns.pl> file in the module distribution.
1094
+
1095
+ =cut
1096
+
1097
+ =head1 C<PeerHost> AND C<LocalHost> PARSING
1098
+
1099
+ To support the C<IO::Socket::INET> API, the host and port information may be
1100
+ passed in a single string rather than as two separate arguments.
1101
+
1102
+ If either C<LocalHost> or C<PeerHost> (or their C<...Addr> synonyms) have any
1103
+ of the following special forms then special parsing is applied.
1104
+
1105
+ The value of the C<...Host> argument will be split to give both the hostname
1106
+ and port (or service name):
1107
+
1108
+ =for highlighter
1109
+
1110
+ hostname.example.org:http # Host name
1111
+ 192.0.2.1:80 # IPv4 address
1112
+ [2001:db8::1]:80 # IPv6 address
1113
+
1114
+ =for highlighter language=perl
1115
+
1116
+ In each case, the port or service name (e.g. C<80>) is passed as the
1117
+ C<LocalService> or C<PeerService> argument.
1118
+
1119
+ Either of C<LocalService> or C<PeerService> (or their C<...Port> synonyms) can
1120
+ be either a service name, a decimal number, or a string containing both a
1121
+ service name and number, in a form such as
1122
+
1123
+ http(80)
1124
+
1125
+ In this case, the name (C<http>) will be tried first, but if the resolver does
1126
+ not understand it then the port number (C<80>) will be used instead.
1127
+
1128
+ If the C<...Host> argument is in this special form and the corresponding
1129
+ C<...Service> or C<...Port> argument is also defined, the one parsed from
1130
+ the C<...Host> argument will take precedence and the other will be ignored.
1131
+
1132
+ =head2 split_addr
1133
+
1134
+ ( $host, $port ) = IO::Socket::IP->split_addr( $addr )
1135
+
1136
+ Utility method that provides the parsing functionality described above.
1137
+ Returns a 2-element list, containing either the split hostname and port
1138
+ description if it could be parsed, or the given address and C<undef> if it was
1139
+ not recognised.
1140
+
1141
+ IO::Socket::IP->split_addr( "hostname:http" );
1142
+ # ( "hostname", "http" )
1143
+
1144
+ IO::Socket::IP->split_addr( "192.0.2.1:80" );
1145
+ # ( "192.0.2.1", "80" )
1146
+
1147
+ IO::Socket::IP->split_addr( "[2001:db8::1]:80" );
1148
+ # ( "2001:db8::1", "80" )
1149
+
1150
+ IO::Socket::IP->split_addr( "something.else" );
1151
+ # ( "something.else", undef )
1152
+
1153
+ =cut
1154
+
1155
+ sub split_addr
1156
+ {
1157
+ shift;
1158
+ my ( $addr ) = @_;
1159
+
1160
+ local ( $1, $2 ); # Placate a taint-related bug; [perl #67962]
1161
+ if( $addr =~ m/\A\[($IPv6_re)\](?::([^\s:]*))?\z/ or
1162
+ $addr =~ m/\A([^\s:]*):([^\s:]*)\z/ ) {
1163
+ return ( $1, $2 ) if defined $2 and length $2;
1164
+ return ( $1, undef );
1165
+ }
1166
+
1167
+ return ( $addr, undef );
1168
+ }
1169
+
1170
+ =head2 join_addr
1171
+
1172
+ $addr = IO::Socket::IP->join_addr( $host, $port )
1173
+
1174
+ Utility method that performs the reverse of C<split_addr>, returning a string
1175
+ formed by joining the specified host address and port number. The host address
1176
+ will be wrapped in C<[]> brackets if required (because it is a raw IPv6
1177
+ numeric address).
1178
+
1179
+ This can be especially useful when combined with the C<sockhost_service> or
1180
+ C<peerhost_service> methods.
1181
+
1182
+ say "Connected to ", IO::Socket::IP->join_addr( $sock->peerhost_service );
1183
+
1184
+ =cut
1185
+
1186
+ sub join_addr
1187
+ {
1188
+ shift;
1189
+ my ( $host, $port ) = @_;
1190
+
1191
+ $host = "[$host]" if $host =~ m/:/;
1192
+
1193
+ return join ":", $host, $port if defined $port;
1194
+ return $host;
1195
+ }
1196
+
1197
+ # Since IO::Socket->new( Domain => ... ) will delete the Domain parameter
1198
+ # before calling ->configure, we need to keep track of which it was
1199
+
1200
+ package # hide from indexer
1201
+ IO::Socket::IP::_ForINET;
1202
+ use base qw( IO::Socket::IP );
1203
+
1204
+ sub configure
1205
+ {
1206
+ # This is evil
1207
+ my $self = shift;
1208
+ my ( $arg ) = @_;
1209
+
1210
+ bless $self, "IO::Socket::IP";
1211
+ $self->configure( { %$arg, Family => Socket::AF_INET() } );
1212
+ }
1213
+
1214
+ package # hide from indexer
1215
+ IO::Socket::IP::_ForINET6;
1216
+ use base qw( IO::Socket::IP );
1217
+
1218
+ sub configure
1219
+ {
1220
+ # This is evil
1221
+ my $self = shift;
1222
+ my ( $arg ) = @_;
1223
+
1224
+ bless $self, "IO::Socket::IP";
1225
+ $self->configure( { %$arg, Family => Socket::AF_INET6() } );
1226
+ }
1227
+
1228
+ =head1 C<IO::Socket::INET> INCOMPATIBILITIES
1229
+
1230
+ =over 4
1231
+
1232
+ =item *
1233
+
1234
+ The behaviour enabled by C<MultiHomed> is in fact implemented by
1235
+ C<IO::Socket::IP> as it is required to correctly support searching for a
1236
+ useable address from the results of the C<getaddrinfo(3)> call. The
1237
+ constructor will ignore the value of this argument, except if it is defined
1238
+ but false. An exception is thrown in this case, because that would request it
1239
+ disable the C<getaddrinfo(3)> search behaviour in the first place.
1240
+
1241
+ =item *
1242
+
1243
+ C<IO::Socket::IP> implements both the C<Blocking> and C<Timeout> parameters,
1244
+ but it implements the interaction of both in a different way.
1245
+
1246
+ In C<::INET>, supplying a timeout overrides the non-blocking behaviour,
1247
+ meaning that the C<connect()> operation will still block despite that the
1248
+ caller asked for a non-blocking socket. This is not explicitly specified in
1249
+ its documentation, nor does this author believe that is a useful behaviour -
1250
+ it appears to come from a quirk of implementation.
1251
+
1252
+ In C<::IP> therefore, the C<Blocking> parameter takes precedence - if a
1253
+ non-blocking socket is requested, no operation will block. The C<Timeout>
1254
+ parameter here simply defines the maximum time that a blocking C<connect()>
1255
+ call will wait, if it blocks at all.
1256
+
1257
+ In order to specifically obtain the "blocking connect then non-blocking send
1258
+ and receive" behaviour of specifying this combination of options to C<::INET>
1259
+ when using C<::IP>, perform first a blocking connect, then afterwards turn the
1260
+ socket into nonblocking mode.
1261
+
1262
+ my $sock = IO::Socket::IP->new(
1263
+ PeerHost => $peer,
1264
+ Timeout => 20,
1265
+ ) or die "Cannot connect - $@";
1266
+
1267
+ $sock->blocking( 0 );
1268
+
1269
+ This code will behave identically under both C<IO::Socket::INET> and
1270
+ C<IO::Socket::IP>.
1271
+
1272
+ =back
1273
+
1274
+ =cut
1275
+
1276
+ =head1 TODO
1277
+
1278
+ =over 4
1279
+
1280
+ =item *
1281
+
1282
+ Investigate whether C<POSIX::dup2> upsets BSD's C<kqueue> watchers, and if so,
1283
+ consider what possible workarounds might be applied.
1284
+
1285
+ =back
1286
+
1287
+ =head1 AUTHOR
1288
+
1289
+ Paul Evans <leonerd@leonerd.org.uk>
1290
+
1291
+ =cut
1292
+
1293
+ 0x55AA;
git/usr/share/perl5/core_perl/IO/Uncompress/AnyInflate.pm ADDED
@@ -0,0 +1,1020 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package IO::Uncompress::AnyInflate ;
2
+
3
+ # for RFC1950, RFC1951 or RFC1952
4
+
5
+ use strict;
6
+ use warnings;
7
+ use bytes;
8
+
9
+ use IO::Compress::Base::Common 2.213 qw(:Parse);
10
+
11
+ use IO::Uncompress::Adapter::Inflate 2.213 ();
12
+
13
+
14
+ use IO::Uncompress::Base 2.213 ;
15
+ use IO::Uncompress::Gunzip 2.213 ;
16
+ use IO::Uncompress::Inflate 2.213 ;
17
+ use IO::Uncompress::RawInflate 2.213 ;
18
+ use IO::Uncompress::Unzip 2.213 ;
19
+
20
+ require Exporter ;
21
+
22
+ our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
23
+
24
+ $VERSION = '2.213';
25
+ $AnyInflateError = '';
26
+
27
+ @ISA = qw(IO::Uncompress::Base Exporter);
28
+ @EXPORT_OK = qw( $AnyInflateError anyinflate ) ;
29
+ %EXPORT_TAGS = %IO::Uncompress::Base::DEFLATE_CONSTANTS if keys %IO::Uncompress::Base::DEFLATE_CONSTANTS;
30
+ push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
31
+ Exporter::export_ok_tags('all');
32
+
33
+ # TODO - allow the user to pick a set of the three formats to allow
34
+ # or just assume want to auto-detect any of the three formats.
35
+
36
+ sub new
37
+ {
38
+ my $class = shift ;
39
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$AnyInflateError);
40
+ $obj->_create(undef, 0, @_);
41
+ }
42
+
43
+ sub anyinflate
44
+ {
45
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$AnyInflateError);
46
+ return $obj->_inf(@_) ;
47
+ }
48
+
49
+ sub getExtraParams
50
+ {
51
+ return ( 'rawinflate' => [Parse_boolean, 0] ) ;
52
+ }
53
+
54
+ sub ckParams
55
+ {
56
+ my $self = shift ;
57
+ my $got = shift ;
58
+
59
+ # any always needs both crc32 and adler32
60
+ $got->setValue('crc32' => 1);
61
+ $got->setValue('adler32' => 1);
62
+
63
+ return 1;
64
+ }
65
+
66
+ sub mkUncomp
67
+ {
68
+ my $self = shift ;
69
+ my $got = shift ;
70
+
71
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject();
72
+
73
+ return $self->saveErrorString(undef, $errstr, $errno)
74
+ if ! defined $obj;
75
+
76
+ *$self->{Uncomp} = $obj;
77
+
78
+ my @possible = qw( Inflate Gunzip Unzip );
79
+ unshift @possible, 'RawInflate'
80
+ if 1 || $got->getValue('rawinflate');
81
+
82
+ my $magic = $self->ckMagic( @possible );
83
+
84
+ if ($magic) {
85
+ *$self->{Info} = $self->readHeader($magic)
86
+ or return undef ;
87
+
88
+ return 1;
89
+ }
90
+
91
+ return 0 ;
92
+ }
93
+
94
+
95
+
96
+ sub ckMagic
97
+ {
98
+ my $self = shift;
99
+ my @names = @_ ;
100
+
101
+ my $keep = ref $self ;
102
+ for my $class ( map { "IO::Uncompress::$_" } @names)
103
+ {
104
+ bless $self => $class;
105
+ my $magic = $self->ckMagic();
106
+
107
+ if ($magic)
108
+ {
109
+ #bless $self => $class;
110
+ return $magic ;
111
+ }
112
+
113
+ $self->pushBack(*$self->{HeaderPending}) ;
114
+ *$self->{HeaderPending} = '' ;
115
+ }
116
+
117
+ bless $self => $keep;
118
+ return undef;
119
+ }
120
+
121
+ 1 ;
122
+
123
+ __END__
124
+
125
+
126
+ =head1 NAME
127
+
128
+ IO::Uncompress::AnyInflate - Uncompress zlib-based (zip, gzip) file/buffer
129
+
130
+ =head1 SYNOPSIS
131
+
132
+ use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ;
133
+
134
+ my $status = anyinflate $input => $output [,OPTS]
135
+ or die "anyinflate failed: $AnyInflateError\n";
136
+
137
+ my $z = IO::Uncompress::AnyInflate->new( $input [OPTS] )
138
+ or die "anyinflate failed: $AnyInflateError\n";
139
+
140
+ $status = $z->read($buffer)
141
+ $status = $z->read($buffer, $length)
142
+ $status = $z->read($buffer, $length, $offset)
143
+ $line = $z->getline()
144
+ $char = $z->getc()
145
+ $char = $z->ungetc()
146
+ $char = $z->opened()
147
+
148
+ $status = $z->inflateSync()
149
+
150
+ $data = $z->trailingData()
151
+ $status = $z->nextStream()
152
+ $data = $z->getHeaderInfo()
153
+ $z->tell()
154
+ $z->seek($position, $whence)
155
+ $z->binmode()
156
+ $z->fileno()
157
+ $z->eof()
158
+ $z->close()
159
+
160
+ $AnyInflateError ;
161
+
162
+ # IO::File mode
163
+
164
+ <$z>
165
+ read($z, $buffer);
166
+ read($z, $buffer, $length);
167
+ read($z, $buffer, $length, $offset);
168
+ tell($z)
169
+ seek($z, $position, $whence)
170
+ binmode($z)
171
+ fileno($z)
172
+ eof($z)
173
+ close($z)
174
+
175
+ =head1 DESCRIPTION
176
+
177
+ This module provides a Perl interface that allows the reading of
178
+ files/buffers that have been compressed in a number of formats that use the
179
+ zlib compression library.
180
+
181
+ The formats supported are
182
+
183
+ =over 5
184
+
185
+ =item RFC 1950
186
+
187
+ =item RFC 1951 (optionally)
188
+
189
+ =item gzip (RFC 1952)
190
+
191
+ =item zip
192
+
193
+ =back
194
+
195
+ The module will auto-detect which, if any, of the supported
196
+ compression formats is being used.
197
+
198
+ =head1 Functional Interface
199
+
200
+ A top-level function, C<anyinflate>, is provided to carry out
201
+ "one-shot" uncompression between buffers and/or files. For finer
202
+ control over the uncompression process, see the L</"OO Interface">
203
+ section.
204
+
205
+ use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ;
206
+
207
+ anyinflate $input_filename_or_reference => $output_filename_or_reference [,OPTS]
208
+ or die "anyinflate failed: $AnyInflateError\n";
209
+
210
+ The functional interface needs Perl5.005 or better.
211
+
212
+ =head2 anyinflate $input_filename_or_reference => $output_filename_or_reference [, OPTS]
213
+
214
+ C<anyinflate> expects at least two parameters,
215
+ C<$input_filename_or_reference> and C<$output_filename_or_reference>
216
+ and zero or more optional parameters (see L</Optional Parameters>)
217
+
218
+ =head3 The C<$input_filename_or_reference> parameter
219
+
220
+ The parameter, C<$input_filename_or_reference>, is used to define the
221
+ source of the compressed data.
222
+
223
+ It can take one of the following forms:
224
+
225
+ =over 5
226
+
227
+ =item A filename
228
+
229
+ If the C<$input_filename_or_reference> parameter is a simple scalar, it is
230
+ assumed to be a filename. This file will be opened for reading and the
231
+ input data will be read from it.
232
+
233
+ =item A filehandle
234
+
235
+ If the C<$input_filename_or_reference> parameter is a filehandle, the input
236
+ data will be read from it. The string '-' can be used as an alias for
237
+ standard input.
238
+
239
+ =item A scalar reference
240
+
241
+ If C<$input_filename_or_reference> is a scalar reference, the input data
242
+ will be read from C<$$input_filename_or_reference>.
243
+
244
+ =item An array reference
245
+
246
+ If C<$input_filename_or_reference> is an array reference, each element in
247
+ the array must be a filename.
248
+
249
+ The input data will be read from each file in turn.
250
+
251
+ The complete array will be walked to ensure that it only
252
+ contains valid filenames before any data is uncompressed.
253
+
254
+ =item An Input FileGlob string
255
+
256
+ If C<$input_filename_or_reference> is a string that is delimited by the
257
+ characters "<" and ">" C<anyinflate> will assume that it is an
258
+ I<input fileglob string>. The input is the list of files that match the
259
+ fileglob.
260
+
261
+ See L<File::GlobMapper|File::GlobMapper> for more details.
262
+
263
+ =back
264
+
265
+ If the C<$input_filename_or_reference> parameter is any other type,
266
+ C<undef> will be returned.
267
+
268
+ =head3 The C<$output_filename_or_reference> parameter
269
+
270
+ The parameter C<$output_filename_or_reference> is used to control the
271
+ destination of the uncompressed data. This parameter can take one of
272
+ these forms.
273
+
274
+ =over 5
275
+
276
+ =item A filename
277
+
278
+ If the C<$output_filename_or_reference> parameter is a simple scalar, it is
279
+ assumed to be a filename. This file will be opened for writing and the
280
+ uncompressed data will be written to it.
281
+
282
+ =item A filehandle
283
+
284
+ If the C<$output_filename_or_reference> parameter is a filehandle, the
285
+ uncompressed data will be written to it. The string '-' can be used as
286
+ an alias for standard output.
287
+
288
+ =item A scalar reference
289
+
290
+ If C<$output_filename_or_reference> is a scalar reference, the
291
+ uncompressed data will be stored in C<$$output_filename_or_reference>.
292
+
293
+ =item An Array Reference
294
+
295
+ If C<$output_filename_or_reference> is an array reference,
296
+ the uncompressed data will be pushed onto the array.
297
+
298
+ =item An Output FileGlob
299
+
300
+ If C<$output_filename_or_reference> is a string that is delimited by the
301
+ characters "<" and ">" C<anyinflate> will assume that it is an
302
+ I<output fileglob string>. The output is the list of files that match the
303
+ fileglob.
304
+
305
+ When C<$output_filename_or_reference> is an fileglob string,
306
+ C<$input_filename_or_reference> must also be a fileglob string. Anything
307
+ else is an error.
308
+
309
+ See L<File::GlobMapper|File::GlobMapper> for more details.
310
+
311
+ =back
312
+
313
+ If the C<$output_filename_or_reference> parameter is any other type,
314
+ C<undef> will be returned.
315
+
316
+ =head2 Notes
317
+
318
+ When C<$input_filename_or_reference> maps to multiple compressed
319
+ files/buffers and C<$output_filename_or_reference> is
320
+ a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a
321
+ concatenation of all the uncompressed data from each of the input
322
+ files/buffers.
323
+
324
+ =head2 Optional Parameters
325
+
326
+ The optional parameters for the one-shot function C<anyinflate>
327
+ are (for the most part) identical to those used with the OO interface defined in the
328
+ L</"Constructor Options"> section. The exceptions are listed below
329
+
330
+ =over 5
331
+
332
+ =item C<< AutoClose => 0|1 >>
333
+
334
+ This option applies to any input or output data streams to
335
+ C<anyinflate> that are filehandles.
336
+
337
+ If C<AutoClose> is specified, and the value is true, it will result in all
338
+ input and/or output filehandles being closed once C<anyinflate> has
339
+ completed.
340
+
341
+ This parameter defaults to 0.
342
+
343
+ =item C<< BinModeOut => 0|1 >>
344
+
345
+ This option is now a no-op. All files will be written in binmode.
346
+
347
+ =item C<< Append => 0|1 >>
348
+
349
+ The behaviour of this option is dependent on the type of output data
350
+ stream.
351
+
352
+ =over 5
353
+
354
+ =item * A Buffer
355
+
356
+ If C<Append> is enabled, all uncompressed data will be append to the end of
357
+ the output buffer. Otherwise the output buffer will be cleared before any
358
+ uncompressed data is written to it.
359
+
360
+ =item * A Filename
361
+
362
+ If C<Append> is enabled, the file will be opened in append mode. Otherwise
363
+ the contents of the file, if any, will be truncated before any uncompressed
364
+ data is written to it.
365
+
366
+ =item * A Filehandle
367
+
368
+ If C<Append> is enabled, the filehandle will be positioned to the end of
369
+ the file via a call to C<seek> before any uncompressed data is
370
+ written to it. Otherwise the file pointer will not be moved.
371
+
372
+ =back
373
+
374
+ When C<Append> is specified, and set to true, it will I<append> all uncompressed
375
+ data to the output data stream.
376
+
377
+ So when the output is a filehandle it will carry out a seek to the eof
378
+ before writing any uncompressed data. If the output is a filename, it will be opened for
379
+ appending. If the output is a buffer, all uncompressed data will be
380
+ appended to the existing buffer.
381
+
382
+ Conversely when C<Append> is not specified, or it is present and is set to
383
+ false, it will operate as follows.
384
+
385
+ When the output is a filename, it will truncate the contents of the file
386
+ before writing any uncompressed data. If the output is a filehandle
387
+ its position will not be changed. If the output is a buffer, it will be
388
+ wiped before any uncompressed data is output.
389
+
390
+ Defaults to 0.
391
+
392
+ =item C<< MultiStream => 0|1 >>
393
+
394
+ If the input file/buffer contains multiple compressed data streams, this
395
+ option will uncompress the whole lot as a single data stream.
396
+
397
+ Defaults to 0.
398
+
399
+ =item C<< TrailingData => $scalar >>
400
+
401
+ Returns the data, if any, that is present immediately after the compressed
402
+ data stream once uncompression is complete.
403
+
404
+ This option can be used when there is useful information immediately
405
+ following the compressed data stream, and you don't know the length of the
406
+ compressed data stream.
407
+
408
+ If the input is a buffer, C<trailingData> will return everything from the
409
+ end of the compressed data stream to the end of the buffer.
410
+
411
+ If the input is a filehandle, C<trailingData> will return the data that is
412
+ left in the filehandle input buffer once the end of the compressed data
413
+ stream has been reached. You can then use the filehandle to read the rest
414
+ of the input file.
415
+
416
+ Don't bother using C<trailingData> if the input is a filename.
417
+
418
+ If you know the length of the compressed data stream before you start
419
+ uncompressing, you can avoid having to use C<trailingData> by setting the
420
+ C<InputLength> option.
421
+
422
+ =back
423
+
424
+ =head2 OneShot Examples
425
+
426
+ To read the contents of the file C<file1.txt.Compressed> and write the
427
+ uncompressed data to the file C<file1.txt>.
428
+
429
+ use strict ;
430
+ use warnings ;
431
+ use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ;
432
+
433
+ my $input = "file1.txt.Compressed";
434
+ my $output = "file1.txt";
435
+ anyinflate $input => $output
436
+ or die "anyinflate failed: $AnyInflateError\n";
437
+
438
+ To read from an existing Perl filehandle, C<$input>, and write the
439
+ uncompressed data to a buffer, C<$buffer>.
440
+
441
+ use strict ;
442
+ use warnings ;
443
+ use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ;
444
+ use IO::File ;
445
+
446
+ my $input = IO::File->new( "<file1.txt.Compressed" )
447
+ or die "Cannot open 'file1.txt.Compressed': $!\n" ;
448
+ my $buffer ;
449
+ anyinflate $input => \$buffer
450
+ or die "anyinflate failed: $AnyInflateError\n";
451
+
452
+ To uncompress all files in the directory "/my/home" that match "*.txt.Compressed" and store the compressed data in the same directory
453
+
454
+ use strict ;
455
+ use warnings ;
456
+ use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ;
457
+
458
+ anyinflate '</my/home/*.txt.Compressed>' => '</my/home/#1.txt>'
459
+ or die "anyinflate failed: $AnyInflateError\n";
460
+
461
+ and if you want to compress each file one at a time, this will do the trick
462
+
463
+ use strict ;
464
+ use warnings ;
465
+ use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ;
466
+
467
+ for my $input ( glob "/my/home/*.txt.Compressed" )
468
+ {
469
+ my $output = $input;
470
+ $output =~ s/.Compressed// ;
471
+ anyinflate $input => $output
472
+ or die "Error compressing '$input': $AnyInflateError\n";
473
+ }
474
+
475
+ =head1 OO Interface
476
+
477
+ =head2 Constructor
478
+
479
+ The format of the constructor for IO::Uncompress::AnyInflate is shown below
480
+
481
+ my $z = IO::Uncompress::AnyInflate->new( $input [OPTS] )
482
+ or die "IO::Uncompress::AnyInflate failed: $AnyInflateError\n";
483
+
484
+ The constructor takes one mandatory parameter, C<$input>, defined below, and
485
+ zero or more C<OPTS>, defined in L<Constructor Options>.
486
+
487
+ Returns an C<IO::Uncompress::AnyInflate> object on success and undef on failure.
488
+ The variable C<$AnyInflateError> will contain an error message on failure.
489
+
490
+ If you are running Perl 5.005 or better the object, C<$z>, returned from
491
+ IO::Uncompress::AnyInflate can be used exactly like an L<IO::File|IO::File> filehandle.
492
+ This means that all normal input file operations can be carried out with
493
+ C<$z>. For example, to read a line from a compressed file/buffer you can
494
+ use either of these forms
495
+
496
+ $line = $z->getline();
497
+ $line = <$z>;
498
+
499
+ Below is a simple exaple of using the OO interface to read the compressed file
500
+ C<myfile.Compressed> and write its contents to stdout.
501
+
502
+ my $filename = "myfile.Compressed";
503
+ my $z = IO::Uncompress::AnyInflate->new($filename)
504
+ or die "IO::Uncompress::AnyInflate failed: $AnyInflateError\n";
505
+
506
+ while (<$z>) {
507
+ print $_;
508
+ }
509
+ $z->close();
510
+
511
+ See L</EXAMPLES> for further examples
512
+
513
+ The mandatory parameter C<$input> is used to determine the source of the
514
+ compressed data. This parameter can take one of three forms.
515
+
516
+ =over 5
517
+
518
+ =item A filename
519
+
520
+ If the C<$input> parameter is a scalar, it is assumed to be a filename. This
521
+ file will be opened for reading and the compressed data will be read from it.
522
+
523
+ =item A filehandle
524
+
525
+ If the C<$input> parameter is a filehandle, the compressed data will be
526
+ read from it.
527
+ The string '-' can be used as an alias for standard input.
528
+
529
+ =item A scalar reference
530
+
531
+ If C<$input> is a scalar reference, the compressed data will be read from
532
+ C<$$input>.
533
+
534
+ =back
535
+
536
+ =head2 Constructor Options
537
+
538
+ The option names defined below are case insensitive and can be optionally
539
+ prefixed by a '-'. So all of the following are valid
540
+
541
+ -AutoClose
542
+ -autoclose
543
+ AUTOCLOSE
544
+ autoclose
545
+
546
+ OPTS is a combination of the following options:
547
+
548
+ =over 5
549
+
550
+ =item C<< AutoClose => 0|1 >>
551
+
552
+ This option is only valid when the C<$input> parameter is a filehandle. If
553
+ specified, and the value is true, it will result in the file being closed once
554
+ either the C<close> method is called or the IO::Uncompress::AnyInflate object is
555
+ destroyed.
556
+
557
+ This parameter defaults to 0.
558
+
559
+ =item C<< MultiStream => 0|1 >>
560
+
561
+ Allows multiple concatenated compressed streams to be treated as a single
562
+ compressed stream. Decompression will stop once either the end of the
563
+ file/buffer is reached, an error is encountered (premature eof, corrupt
564
+ compressed data) or the end of a stream is not immediately followed by the
565
+ start of another stream.
566
+
567
+ This parameter defaults to 0.
568
+
569
+ =item C<< Prime => $string >>
570
+
571
+ This option will uncompress the contents of C<$string> before processing the
572
+ input file/buffer.
573
+
574
+ This option can be useful when the compressed data is embedded in another
575
+ file/data structure and it is not possible to work out where the compressed
576
+ data begins without having to read the first few bytes. If this is the
577
+ case, the uncompression can be I<primed> with these bytes using this
578
+ option.
579
+
580
+ =item C<< Transparent => 0|1 >>
581
+
582
+ If this option is set and the input file/buffer is not compressed data,
583
+ the module will allow reading of it anyway.
584
+
585
+ In addition, if the input file/buffer does contain compressed data and
586
+ there is non-compressed data immediately following it, setting this option
587
+ will make this module treat the whole file/buffer as a single data stream.
588
+
589
+ This option defaults to 1.
590
+
591
+ =item C<< BlockSize => $num >>
592
+
593
+ When reading the compressed input data, IO::Uncompress::AnyInflate will read it in
594
+ blocks of C<$num> bytes.
595
+
596
+ This option defaults to 4096.
597
+
598
+ =item C<< InputLength => $size >>
599
+
600
+ When present this option will limit the number of compressed bytes read
601
+ from the input file/buffer to C<$size>. This option can be used in the
602
+ situation where there is useful data directly after the compressed data
603
+ stream and you know beforehand the exact length of the compressed data
604
+ stream.
605
+
606
+ This option is mostly used when reading from a filehandle, in which case
607
+ the file pointer will be left pointing to the first byte directly after the
608
+ compressed data stream.
609
+
610
+ This option defaults to off.
611
+
612
+ =item C<< Append => 0|1 >>
613
+
614
+ This option controls what the C<read> method does with uncompressed data.
615
+
616
+ If set to 1, all uncompressed data will be appended to the output parameter
617
+ of the C<read> method.
618
+
619
+ If set to 0, the contents of the output parameter of the C<read> method
620
+ will be overwritten by the uncompressed data.
621
+
622
+ Defaults to 0.
623
+
624
+ =item C<< Strict => 0|1 >>
625
+
626
+ This option controls whether the extra checks defined below are used when
627
+ carrying out the decompression. When Strict is on, the extra tests are
628
+ carried out, when Strict is off they are not.
629
+
630
+ The default for this option is off.
631
+
632
+ If the input is an RFC 1950 data stream, the following will be checked:
633
+
634
+ =over 5
635
+
636
+ =item 1
637
+
638
+ The ADLER32 checksum field must be present.
639
+
640
+ =item 2
641
+
642
+ The value of the ADLER32 field read must match the adler32 value of the
643
+ uncompressed data actually contained in the file.
644
+
645
+ =back
646
+
647
+ If the input is a gzip (RFC 1952) data stream, the following will be checked:
648
+
649
+ =over 5
650
+
651
+ =item 1
652
+
653
+ If the FHCRC bit is set in the gzip FLG header byte, the CRC16 bytes in the
654
+ header must match the crc16 value of the gzip header actually read.
655
+
656
+ =item 2
657
+
658
+ If the gzip header contains a name field (FNAME) it consists solely of ISO
659
+ 8859-1 characters.
660
+
661
+ =item 3
662
+
663
+ If the gzip header contains a comment field (FCOMMENT) it consists solely
664
+ of ISO 8859-1 characters plus line-feed.
665
+
666
+ =item 4
667
+
668
+ If the gzip FEXTRA header field is present it must conform to the sub-field
669
+ structure as defined in RFC 1952.
670
+
671
+ =item 5
672
+
673
+ The CRC32 and ISIZE trailer fields must be present.
674
+
675
+ =item 6
676
+
677
+ The value of the CRC32 field read must match the crc32 value of the
678
+ uncompressed data actually contained in the gzip file.
679
+
680
+ =item 7
681
+
682
+ The value of the ISIZE fields read must match the length of the
683
+ uncompressed data actually read from the file.
684
+
685
+ =back
686
+
687
+ =item C<< RawInflate => 0|1 >>
688
+
689
+ When auto-detecting the compressed format, try to test for raw-deflate (RFC
690
+ 1951) content using the C<IO::Uncompress::RawInflate> module.
691
+
692
+ The reason this is not default behaviour is because RFC 1951 content can
693
+ only be detected by attempting to uncompress it. This process is error
694
+ prone and can result is false positives.
695
+
696
+ Defaults to 0.
697
+
698
+ =item C<< ParseExtra => 0|1 >>
699
+ If the gzip FEXTRA header field is present and this option is set, it will
700
+ force the module to check that it conforms to the sub-field structure as
701
+ defined in RFC 1952.
702
+
703
+ If the C<Strict> is on it will automatically enable this option.
704
+
705
+ Defaults to 0.
706
+
707
+ =back
708
+
709
+ =head1 Methods
710
+
711
+ =head2 read
712
+
713
+ Usage is
714
+
715
+ $status = $z->read($buffer)
716
+
717
+ Reads a block of compressed data (the size of the compressed block is
718
+ determined by the C<Buffer> option in the constructor), uncompresses it and
719
+ writes any uncompressed data into C<$buffer>. If the C<Append> parameter is
720
+ set in the constructor, the uncompressed data will be appended to the
721
+ C<$buffer> parameter. Otherwise C<$buffer> will be overwritten.
722
+
723
+ Returns the number of uncompressed bytes written to C<$buffer>, zero if eof
724
+ or a negative number on error.
725
+
726
+ =head2 read
727
+
728
+ Usage is
729
+
730
+ $status = $z->read($buffer, $length)
731
+ $status = $z->read($buffer, $length, $offset)
732
+
733
+ $status = read($z, $buffer, $length)
734
+ $status = read($z, $buffer, $length, $offset)
735
+
736
+ Attempt to read C<$length> bytes of uncompressed data into C<$buffer>.
737
+
738
+ The main difference between this form of the C<read> method and the
739
+ previous one, is that this one will attempt to return I<exactly> C<$length>
740
+ bytes. The only circumstances that this function will not is if end-of-file
741
+ or an IO error is encountered.
742
+
743
+ Returns the number of uncompressed bytes written to C<$buffer>, zero if eof
744
+ or a negative number on error.
745
+
746
+ =head2 getline
747
+
748
+ Usage is
749
+
750
+ $line = $z->getline()
751
+ $line = <$z>
752
+
753
+ Reads a single line.
754
+
755
+ This method fully supports the use of the variable C<$/> (or
756
+ C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to
757
+ determine what constitutes an end of line. Paragraph mode, record mode and
758
+ file slurp mode are all supported.
759
+
760
+ =head2 getc
761
+
762
+ Usage is
763
+
764
+ $char = $z->getc()
765
+
766
+ Read a single character.
767
+
768
+ =head2 ungetc
769
+
770
+ Usage is
771
+
772
+ $char = $z->ungetc($string)
773
+
774
+ =head2 inflateSync
775
+
776
+ Usage is
777
+
778
+ $status = $z->inflateSync()
779
+
780
+ TODO
781
+
782
+ =head2 getHeaderInfo
783
+
784
+ Usage is
785
+
786
+ $hdr = $z->getHeaderInfo();
787
+ @hdrs = $z->getHeaderInfo();
788
+
789
+ This method returns either a hash reference (in scalar context) or a list
790
+ or hash references (in array context) that contains information about each
791
+ of the header fields in the compressed data stream(s).
792
+
793
+ =head2 tell
794
+
795
+ Usage is
796
+
797
+ $z->tell()
798
+ tell $z
799
+
800
+ Returns the uncompressed file offset.
801
+
802
+ =head2 eof
803
+
804
+ Usage is
805
+
806
+ $z->eof();
807
+ eof($z);
808
+
809
+ Returns true if the end of the compressed input stream has been reached.
810
+
811
+ =head2 seek
812
+
813
+ $z->seek($position, $whence);
814
+ seek($z, $position, $whence);
815
+
816
+ Provides a sub-set of the C<seek> functionality, with the restriction
817
+ that it is only legal to seek forward in the input file/buffer.
818
+ It is a fatal error to attempt to seek backward.
819
+
820
+ Note that the implementation of C<seek> in this module does not provide
821
+ true random access to a compressed file/buffer. It works by uncompressing
822
+ data from the current offset in the file/buffer until it reaches the
823
+ uncompressed offset specified in the parameters to C<seek>. For very small
824
+ files this may be acceptable behaviour. For large files it may cause an
825
+ unacceptable delay.
826
+
827
+ The C<$whence> parameter takes one the usual values, namely SEEK_SET,
828
+ SEEK_CUR or SEEK_END.
829
+
830
+ Returns 1 on success, 0 on failure.
831
+
832
+ =head2 binmode
833
+
834
+ Usage is
835
+
836
+ $z->binmode
837
+ binmode $z ;
838
+
839
+ This is a noop provided for completeness.
840
+
841
+ =head2 opened
842
+
843
+ $z->opened()
844
+
845
+ Returns true if the object currently refers to a opened file/buffer.
846
+
847
+ =head2 autoflush
848
+
849
+ my $prev = $z->autoflush()
850
+ my $prev = $z->autoflush(EXPR)
851
+
852
+ If the C<$z> object is associated with a file or a filehandle, this method
853
+ returns the current autoflush setting for the underlying filehandle. If
854
+ C<EXPR> is present, and is non-zero, it will enable flushing after every
855
+ write/print operation.
856
+
857
+ If C<$z> is associated with a buffer, this method has no effect and always
858
+ returns C<undef>.
859
+
860
+ B<Note> that the special variable C<$|> B<cannot> be used to set or
861
+ retrieve the autoflush setting.
862
+
863
+ =head2 input_line_number
864
+
865
+ $z->input_line_number()
866
+ $z->input_line_number(EXPR)
867
+
868
+ Returns the current uncompressed line number. If C<EXPR> is present it has
869
+ the effect of setting the line number. Note that setting the line number
870
+ does not change the current position within the file/buffer being read.
871
+
872
+ The contents of C<$/> are used to determine what constitutes a line
873
+ terminator.
874
+
875
+ =head2 fileno
876
+
877
+ $z->fileno()
878
+ fileno($z)
879
+
880
+ If the C<$z> object is associated with a file or a filehandle, C<fileno>
881
+ will return the underlying file descriptor. Once the C<close> method is
882
+ called C<fileno> will return C<undef>.
883
+
884
+ If the C<$z> object is associated with a buffer, this method will return
885
+ C<undef>.
886
+
887
+ =head2 close
888
+
889
+ $z->close() ;
890
+ close $z ;
891
+
892
+ Closes the output file/buffer.
893
+
894
+ For most versions of Perl this method will be automatically invoked if
895
+ the IO::Uncompress::AnyInflate object is destroyed (either explicitly or by the
896
+ variable with the reference to the object going out of scope). The
897
+ exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In
898
+ these cases, the C<close> method will be called automatically, but
899
+ not until global destruction of all live objects when the program is
900
+ terminating.
901
+
902
+ Therefore, if you want your scripts to be able to run on all versions
903
+ of Perl, you should call C<close> explicitly and not rely on automatic
904
+ closing.
905
+
906
+ Returns true on success, otherwise 0.
907
+
908
+ If the C<AutoClose> option has been enabled when the IO::Uncompress::AnyInflate
909
+ object was created, and the object is associated with a file, the
910
+ underlying file will also be closed.
911
+
912
+ =head2 nextStream
913
+
914
+ Usage is
915
+
916
+ my $status = $z->nextStream();
917
+
918
+ Skips to the next compressed data stream in the input file/buffer. If a new
919
+ compressed data stream is found, the eof marker will be cleared and C<$.>
920
+ will be reset to 0.
921
+
922
+ Returns 1 if a new stream was found, 0 if none was found, and -1 if an
923
+ error was encountered.
924
+
925
+ =head2 trailingData
926
+
927
+ Usage is
928
+
929
+ my $data = $z->trailingData();
930
+
931
+ Returns the data, if any, that is present immediately after the compressed
932
+ data stream once uncompression is complete. It only makes sense to call
933
+ this method once the end of the compressed data stream has been
934
+ encountered.
935
+
936
+ This option can be used when there is useful information immediately
937
+ following the compressed data stream, and you don't know the length of the
938
+ compressed data stream.
939
+
940
+ If the input is a buffer, C<trailingData> will return everything from the
941
+ end of the compressed data stream to the end of the buffer.
942
+
943
+ If the input is a filehandle, C<trailingData> will return the data that is
944
+ left in the filehandle input buffer once the end of the compressed data
945
+ stream has been reached. You can then use the filehandle to read the rest
946
+ of the input file.
947
+
948
+ Don't bother using C<trailingData> if the input is a filename.
949
+
950
+ If you know the length of the compressed data stream before you start
951
+ uncompressing, you can avoid having to use C<trailingData> by setting the
952
+ C<InputLength> option in the constructor.
953
+
954
+ =head1 Importing
955
+
956
+ No symbolic constants are required by IO::Uncompress::AnyInflate at present.
957
+
958
+ =over 5
959
+
960
+ =item :all
961
+
962
+ Imports C<anyinflate> and C<$AnyInflateError>.
963
+ Same as doing this
964
+
965
+ use IO::Uncompress::AnyInflate qw(anyinflate $AnyInflateError) ;
966
+
967
+ =back
968
+
969
+ =head1 EXAMPLES
970
+
971
+ =head2 Working with Net::FTP
972
+
973
+ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
974
+
975
+ =head1 SUPPORT
976
+
977
+ General feedback/questions/bug reports should be sent to
978
+ L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
979
+ L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
980
+
981
+ =head1 SEE ALSO
982
+
983
+ L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyUncompress>
984
+
985
+ L<IO::Compress::FAQ|IO::Compress::FAQ>
986
+
987
+ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
988
+ L<Archive::Tar|Archive::Tar>,
989
+ L<IO::Zlib|IO::Zlib>
990
+
991
+ For RFC 1950, 1951 and 1952 see
992
+ L<https://datatracker.ietf.org/doc/html/rfc1950>,
993
+ L<https://datatracker.ietf.org/doc/html/rfc1951> and
994
+ L<https://datatracker.ietf.org/doc/html/rfc1952>
995
+
996
+ The I<zlib> compression library was written by Jean-loup Gailly
997
+ C<gzip@prep.ai.mit.edu> and Mark Adler C<madler@alumni.caltech.edu>.
998
+
999
+ The primary site for the I<zlib> compression library is
1000
+ L<http://www.zlib.org>.
1001
+
1002
+ The primary site for the I<zlib-ng> compression library is
1003
+ L<https://github.com/zlib-ng/zlib-ng>.
1004
+
1005
+ The primary site for gzip is L<http://www.gzip.org>.
1006
+
1007
+ =head1 AUTHOR
1008
+
1009
+ This module was written by Paul Marquess, C<pmqs@cpan.org>.
1010
+
1011
+ =head1 MODIFICATION HISTORY
1012
+
1013
+ See the Changes file.
1014
+
1015
+ =head1 COPYRIGHT AND LICENSE
1016
+
1017
+ Copyright (c) 2005-2024 Paul Marquess. All rights reserved.
1018
+
1019
+ This program is free software; you can redistribute it and/or
1020
+ modify it under the same terms as Perl itself.
git/usr/share/perl5/core_perl/IO/Uncompress/AnyUncompress.pm ADDED
@@ -0,0 +1,1096 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package IO::Uncompress::AnyUncompress ;
2
+
3
+ use strict;
4
+ use warnings;
5
+ use bytes;
6
+
7
+ use IO::Compress::Base::Common 2.213 ();
8
+
9
+ use IO::Uncompress::Base 2.213 ;
10
+
11
+
12
+ require Exporter ;
13
+
14
+ our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
15
+
16
+ $VERSION = '2.213';
17
+ $AnyUncompressError = '';
18
+
19
+ @ISA = qw(IO::Uncompress::Base Exporter);
20
+ @EXPORT_OK = qw( $AnyUncompressError anyuncompress ) ;
21
+ %EXPORT_TAGS = %IO::Uncompress::Base::DEFLATE_CONSTANTS if keys %IO::Uncompress::Base::DEFLATE_CONSTANTS;
22
+ push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
23
+ Exporter::export_ok_tags('all');
24
+
25
+ # TODO - allow the user to pick a set of the three formats to allow
26
+ # or just assume want to auto-detect any of the three formats.
27
+
28
+ BEGIN
29
+ {
30
+ local @INC = @INC;
31
+ pop @INC if $INC[-1] eq '.';
32
+
33
+ # Don't trigger any __DIE__ Hooks.
34
+ local $SIG{__DIE__};
35
+
36
+ eval ' use IO::Uncompress::Adapter::Inflate 2.213 ;';
37
+ eval ' use IO::Uncompress::Adapter::Bunzip2 2.213 ;';
38
+ eval ' use IO::Uncompress::Adapter::LZO 2.213 ;';
39
+ eval ' use IO::Uncompress::Adapter::Lzf 2.213 ;';
40
+ eval ' use IO::Uncompress::Adapter::UnLzma 2.213 ;';
41
+ eval ' use IO::Uncompress::Adapter::UnXz 2.213 ;';
42
+ eval ' use IO::Uncompress::Adapter::UnZstd 2.213 ;';
43
+ eval ' use IO::Uncompress::Adapter::UnLzip 2.213 ;';
44
+
45
+ eval ' use IO::Uncompress::Bunzip2 2.213 ;';
46
+ eval ' use IO::Uncompress::UnLzop 2.213 ;';
47
+ eval ' use IO::Uncompress::Gunzip 2.213 ;';
48
+ eval ' use IO::Uncompress::Inflate 2.213 ;';
49
+ eval ' use IO::Uncompress::RawInflate 2.213 ;';
50
+ eval ' use IO::Uncompress::Unzip 2.213 ;';
51
+ eval ' use IO::Uncompress::UnLzf 2.213 ;';
52
+ eval ' use IO::Uncompress::UnLzma 2.213 ;';
53
+ eval ' use IO::Uncompress::UnXz 2.213 ;';
54
+ eval ' use IO::Uncompress::UnZstd 2.213 ;';
55
+ eval ' use IO::Uncompress::UnLzip 2.213 ;';
56
+
57
+ }
58
+
59
+ sub new
60
+ {
61
+ my $class = shift ;
62
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$AnyUncompressError);
63
+ $obj->_create(undef, 0, @_);
64
+ }
65
+
66
+ sub anyuncompress
67
+ {
68
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$AnyUncompressError);
69
+ return $obj->_inf(@_) ;
70
+ }
71
+
72
+ sub getExtraParams
73
+ {
74
+ return ( 'rawinflate' => [IO::Compress::Base::Common::Parse_boolean, 0] ,
75
+ 'unlzma' => [IO::Compress::Base::Common::Parse_boolean, 0] ) ;
76
+ }
77
+
78
+ sub ckParams
79
+ {
80
+ my $self = shift ;
81
+ my $got = shift ;
82
+
83
+ # any always needs both crc32 and adler32
84
+ $got->setValue('crc32' => 1);
85
+ $got->setValue('adler32' => 1);
86
+
87
+ return 1;
88
+ }
89
+
90
+ sub mkUncomp
91
+ {
92
+ my $self = shift ;
93
+ my $got = shift ;
94
+
95
+ my $magic ;
96
+
97
+ # try zlib first
98
+ if (defined $IO::Uncompress::RawInflate::VERSION )
99
+ {
100
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject();
101
+
102
+ return $self->saveErrorString(undef, $errstr, $errno)
103
+ if ! defined $obj;
104
+
105
+ *$self->{Uncomp} = $obj;
106
+
107
+ my @possible = qw( Inflate Gunzip Unzip );
108
+ unshift @possible, 'RawInflate'
109
+ if $got->getValue('rawinflate');
110
+
111
+ $magic = $self->ckMagic( @possible );
112
+
113
+ if ($magic) {
114
+ *$self->{Info} = $self->readHeader($magic)
115
+ or return undef ;
116
+
117
+ return 1;
118
+ }
119
+ }
120
+
121
+ if (defined $IO::Uncompress::UnLzma::VERSION && $got->getValue('unlzma'))
122
+ {
123
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::UnLzma::mkUncompObject();
124
+
125
+ return $self->saveErrorString(undef, $errstr, $errno)
126
+ if ! defined $obj;
127
+
128
+ *$self->{Uncomp} = $obj;
129
+
130
+ my @possible = qw( UnLzma );
131
+ #unshift @possible, 'RawInflate'
132
+ # if $got->getValue('rawinflate');
133
+
134
+ if ( *$self->{Info} = $self->ckMagic( @possible ))
135
+ {
136
+ return 1;
137
+ }
138
+ }
139
+
140
+ if (defined $IO::Uncompress::UnXz::VERSION and
141
+ $magic = $self->ckMagic('UnXz')) {
142
+ *$self->{Info} = $self->readHeader($magic)
143
+ or return undef ;
144
+
145
+ my ($obj, $errstr, $errno) =
146
+ IO::Uncompress::Adapter::UnXz::mkUncompObject();
147
+
148
+ return $self->saveErrorString(undef, $errstr, $errno)
149
+ if ! defined $obj;
150
+
151
+ *$self->{Uncomp} = $obj;
152
+
153
+ return 1;
154
+ }
155
+
156
+ if (defined $IO::Uncompress::Bunzip2::VERSION and
157
+ $magic = $self->ckMagic('Bunzip2')) {
158
+ *$self->{Info} = $self->readHeader($magic)
159
+ or return undef ;
160
+
161
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Bunzip2::mkUncompObject();
162
+
163
+ return $self->saveErrorString(undef, $errstr, $errno)
164
+ if ! defined $obj;
165
+
166
+ *$self->{Uncomp} = $obj;
167
+
168
+ return 1;
169
+ }
170
+
171
+ if (defined $IO::Uncompress::UnLzop::VERSION and
172
+ $magic = $self->ckMagic('UnLzop')) {
173
+
174
+ *$self->{Info} = $self->readHeader($magic)
175
+ or return undef ;
176
+
177
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::LZO::mkUncompObject();
178
+
179
+ return $self->saveErrorString(undef, $errstr, $errno)
180
+ if ! defined $obj;
181
+
182
+ *$self->{Uncomp} = $obj;
183
+
184
+ return 1;
185
+ }
186
+
187
+ if (defined $IO::Uncompress::UnLzf::VERSION and
188
+ $magic = $self->ckMagic('UnLzf')) {
189
+
190
+ *$self->{Info} = $self->readHeader($magic)
191
+ or return undef ;
192
+
193
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Lzf::mkUncompObject();
194
+
195
+ return $self->saveErrorString(undef, $errstr, $errno)
196
+ if ! defined $obj;
197
+
198
+ *$self->{Uncomp} = $obj;
199
+
200
+ return 1;
201
+ }
202
+
203
+ if (defined $IO::Uncompress::UnZstd::VERSION and
204
+ $magic = $self->ckMagic('UnZstd')) {
205
+
206
+ *$self->{Info} = $self->readHeader($magic)
207
+ or return undef ;
208
+
209
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::UnZstd::mkUncompObject();
210
+
211
+ return $self->saveErrorString(undef, $errstr, $errno)
212
+ if ! defined $obj;
213
+
214
+ *$self->{Uncomp} = $obj;
215
+
216
+ return 1;
217
+ }
218
+
219
+
220
+ if (defined $IO::Uncompress::UnLzip::VERSION and
221
+ $magic = $self->ckMagic('UnLzip')) {
222
+
223
+ *$self->{Info} = $self->readHeader($magic)
224
+ or return undef ;
225
+
226
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::UnLzip::mkUncompObject(*$self->{Info}{DictSize});
227
+
228
+ return $self->saveErrorString(undef, $errstr, $errno)
229
+ if ! defined $obj;
230
+
231
+ *$self->{Uncomp} = $obj;
232
+
233
+ return 1;
234
+ }
235
+
236
+ return 0 ;
237
+ }
238
+
239
+
240
+
241
+ sub ckMagic
242
+ {
243
+ my $self = shift;
244
+ my @names = @_ ;
245
+
246
+ my $keep = ref $self ;
247
+ for my $class ( map { "IO::Uncompress::$_" } @names)
248
+ {
249
+ bless $self => $class;
250
+ my $magic = $self->ckMagic();
251
+
252
+ if ($magic)
253
+ {
254
+ #bless $self => $class;
255
+ return $magic ;
256
+ }
257
+
258
+ $self->pushBack(*$self->{HeaderPending}) ;
259
+ *$self->{HeaderPending} = '' ;
260
+ }
261
+
262
+ bless $self => $keep;
263
+ return undef;
264
+ }
265
+
266
+ 1 ;
267
+
268
+ __END__
269
+
270
+
271
+ =head1 NAME
272
+
273
+ IO::Uncompress::AnyUncompress - Uncompress gzip, zip, bzip2, zstd, xz, lzma, lzip, lzf or lzop file/buffer
274
+
275
+ =head1 SYNOPSIS
276
+
277
+ use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ;
278
+
279
+ my $status = anyuncompress $input => $output [,OPTS]
280
+ or die "anyuncompress failed: $AnyUncompressError\n";
281
+
282
+ my $z = IO::Uncompress::AnyUncompress->new( $input [OPTS] )
283
+ or die "anyuncompress failed: $AnyUncompressError\n";
284
+
285
+ $status = $z->read($buffer)
286
+ $status = $z->read($buffer, $length)
287
+ $status = $z->read($buffer, $length, $offset)
288
+ $line = $z->getline()
289
+ $char = $z->getc()
290
+ $char = $z->ungetc()
291
+ $char = $z->opened()
292
+
293
+ $data = $z->trailingData()
294
+ $status = $z->nextStream()
295
+ $data = $z->getHeaderInfo()
296
+ $z->tell()
297
+ $z->seek($position, $whence)
298
+ $z->binmode()
299
+ $z->fileno()
300
+ $z->eof()
301
+ $z->close()
302
+
303
+ $AnyUncompressError ;
304
+
305
+ # IO::File mode
306
+
307
+ <$z>
308
+ read($z, $buffer);
309
+ read($z, $buffer, $length);
310
+ read($z, $buffer, $length, $offset);
311
+ tell($z)
312
+ seek($z, $position, $whence)
313
+ binmode($z)
314
+ fileno($z)
315
+ eof($z)
316
+ close($z)
317
+
318
+ =head1 DESCRIPTION
319
+
320
+ This module provides a Perl interface that allows the reading of
321
+ files/buffers that have been compressed with a variety of compression
322
+ libraries.
323
+
324
+ The formats supported are:
325
+
326
+ =over 5
327
+
328
+ =item RFC 1950
329
+
330
+ =item RFC 1951 (optionally)
331
+
332
+ =item gzip (RFC 1952)
333
+
334
+ =item zip
335
+
336
+ =item zstd (Zstandard)
337
+
338
+ =item bzip2
339
+
340
+ =item lzop
341
+
342
+ =item lzf
343
+
344
+ =item lzma
345
+
346
+ =item lzip
347
+
348
+ =item xz
349
+
350
+ =back
351
+
352
+ The module will auto-detect which, if any, of the supported
353
+ compression formats is being used.
354
+
355
+ =head1 Functional Interface
356
+
357
+ A top-level function, C<anyuncompress>, is provided to carry out
358
+ "one-shot" uncompression between buffers and/or files. For finer
359
+ control over the uncompression process, see the L</"OO Interface">
360
+ section.
361
+
362
+ use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ;
363
+
364
+ anyuncompress $input_filename_or_reference => $output_filename_or_reference [,OPTS]
365
+ or die "anyuncompress failed: $AnyUncompressError\n";
366
+
367
+ The functional interface needs Perl5.005 or better.
368
+
369
+ =head2 anyuncompress $input_filename_or_reference => $output_filename_or_reference [, OPTS]
370
+
371
+ C<anyuncompress> expects at least two parameters,
372
+ C<$input_filename_or_reference> and C<$output_filename_or_reference>
373
+ and zero or more optional parameters (see L</Optional Parameters>)
374
+
375
+ =head3 The C<$input_filename_or_reference> parameter
376
+
377
+ The parameter, C<$input_filename_or_reference>, is used to define the
378
+ source of the compressed data.
379
+
380
+ It can take one of the following forms:
381
+
382
+ =over 5
383
+
384
+ =item A filename
385
+
386
+ If the C<$input_filename_or_reference> parameter is a simple scalar, it is
387
+ assumed to be a filename. This file will be opened for reading and the
388
+ input data will be read from it.
389
+
390
+ =item A filehandle
391
+
392
+ If the C<$input_filename_or_reference> parameter is a filehandle, the input
393
+ data will be read from it. The string '-' can be used as an alias for
394
+ standard input.
395
+
396
+ =item A scalar reference
397
+
398
+ If C<$input_filename_or_reference> is a scalar reference, the input data
399
+ will be read from C<$$input_filename_or_reference>.
400
+
401
+ =item An array reference
402
+
403
+ If C<$input_filename_or_reference> is an array reference, each element in
404
+ the array must be a filename.
405
+
406
+ The input data will be read from each file in turn.
407
+
408
+ The complete array will be walked to ensure that it only
409
+ contains valid filenames before any data is uncompressed.
410
+
411
+ =item An Input FileGlob string
412
+
413
+ If C<$input_filename_or_reference> is a string that is delimited by the
414
+ characters "<" and ">" C<anyuncompress> will assume that it is an
415
+ I<input fileglob string>. The input is the list of files that match the
416
+ fileglob.
417
+
418
+ See L<File::GlobMapper|File::GlobMapper> for more details.
419
+
420
+ =back
421
+
422
+ If the C<$input_filename_or_reference> parameter is any other type,
423
+ C<undef> will be returned.
424
+
425
+ =head3 The C<$output_filename_or_reference> parameter
426
+
427
+ The parameter C<$output_filename_or_reference> is used to control the
428
+ destination of the uncompressed data. This parameter can take one of
429
+ these forms.
430
+
431
+ =over 5
432
+
433
+ =item A filename
434
+
435
+ If the C<$output_filename_or_reference> parameter is a simple scalar, it is
436
+ assumed to be a filename. This file will be opened for writing and the
437
+ uncompressed data will be written to it.
438
+
439
+ =item A filehandle
440
+
441
+ If the C<$output_filename_or_reference> parameter is a filehandle, the
442
+ uncompressed data will be written to it. The string '-' can be used as
443
+ an alias for standard output.
444
+
445
+ =item A scalar reference
446
+
447
+ If C<$output_filename_or_reference> is a scalar reference, the
448
+ uncompressed data will be stored in C<$$output_filename_or_reference>.
449
+
450
+ =item An Array Reference
451
+
452
+ If C<$output_filename_or_reference> is an array reference,
453
+ the uncompressed data will be pushed onto the array.
454
+
455
+ =item An Output FileGlob
456
+
457
+ If C<$output_filename_or_reference> is a string that is delimited by the
458
+ characters "<" and ">" C<anyuncompress> will assume that it is an
459
+ I<output fileglob string>. The output is the list of files that match the
460
+ fileglob.
461
+
462
+ When C<$output_filename_or_reference> is an fileglob string,
463
+ C<$input_filename_or_reference> must also be a fileglob string. Anything
464
+ else is an error.
465
+
466
+ See L<File::GlobMapper|File::GlobMapper> for more details.
467
+
468
+ =back
469
+
470
+ If the C<$output_filename_or_reference> parameter is any other type,
471
+ C<undef> will be returned.
472
+
473
+ =head2 Notes
474
+
475
+ When C<$input_filename_or_reference> maps to multiple compressed
476
+ files/buffers and C<$output_filename_or_reference> is
477
+ a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a
478
+ concatenation of all the uncompressed data from each of the input
479
+ files/buffers.
480
+
481
+ =head2 Optional Parameters
482
+
483
+ The optional parameters for the one-shot function C<anyuncompress>
484
+ are (for the most part) identical to those used with the OO interface defined in the
485
+ L</"Constructor Options"> section. The exceptions are listed below
486
+
487
+ =over 5
488
+
489
+ =item C<< AutoClose => 0|1 >>
490
+
491
+ This option applies to any input or output data streams to
492
+ C<anyuncompress> that are filehandles.
493
+
494
+ If C<AutoClose> is specified, and the value is true, it will result in all
495
+ input and/or output filehandles being closed once C<anyuncompress> has
496
+ completed.
497
+
498
+ This parameter defaults to 0.
499
+
500
+ =item C<< BinModeOut => 0|1 >>
501
+
502
+ This option is now a no-op. All files will be written in binmode.
503
+
504
+ =item C<< Append => 0|1 >>
505
+
506
+ The behaviour of this option is dependent on the type of output data
507
+ stream.
508
+
509
+ =over 5
510
+
511
+ =item * A Buffer
512
+
513
+ If C<Append> is enabled, all uncompressed data will be append to the end of
514
+ the output buffer. Otherwise the output buffer will be cleared before any
515
+ uncompressed data is written to it.
516
+
517
+ =item * A Filename
518
+
519
+ If C<Append> is enabled, the file will be opened in append mode. Otherwise
520
+ the contents of the file, if any, will be truncated before any uncompressed
521
+ data is written to it.
522
+
523
+ =item * A Filehandle
524
+
525
+ If C<Append> is enabled, the filehandle will be positioned to the end of
526
+ the file via a call to C<seek> before any uncompressed data is
527
+ written to it. Otherwise the file pointer will not be moved.
528
+
529
+ =back
530
+
531
+ When C<Append> is specified, and set to true, it will I<append> all uncompressed
532
+ data to the output data stream.
533
+
534
+ So when the output is a filehandle it will carry out a seek to the eof
535
+ before writing any uncompressed data. If the output is a filename, it will be opened for
536
+ appending. If the output is a buffer, all uncompressed data will be
537
+ appended to the existing buffer.
538
+
539
+ Conversely when C<Append> is not specified, or it is present and is set to
540
+ false, it will operate as follows.
541
+
542
+ When the output is a filename, it will truncate the contents of the file
543
+ before writing any uncompressed data. If the output is a filehandle
544
+ its position will not be changed. If the output is a buffer, it will be
545
+ wiped before any uncompressed data is output.
546
+
547
+ Defaults to 0.
548
+
549
+ =item C<< MultiStream => 0|1 >>
550
+
551
+ If the input file/buffer contains multiple compressed data streams, this
552
+ option will uncompress the whole lot as a single data stream.
553
+
554
+ Defaults to 0.
555
+
556
+ =item C<< TrailingData => $scalar >>
557
+
558
+ Returns the data, if any, that is present immediately after the compressed
559
+ data stream once uncompression is complete.
560
+
561
+ This option can be used when there is useful information immediately
562
+ following the compressed data stream, and you don't know the length of the
563
+ compressed data stream.
564
+
565
+ If the input is a buffer, C<trailingData> will return everything from the
566
+ end of the compressed data stream to the end of the buffer.
567
+
568
+ If the input is a filehandle, C<trailingData> will return the data that is
569
+ left in the filehandle input buffer once the end of the compressed data
570
+ stream has been reached. You can then use the filehandle to read the rest
571
+ of the input file.
572
+
573
+ Don't bother using C<trailingData> if the input is a filename.
574
+
575
+ If you know the length of the compressed data stream before you start
576
+ uncompressing, you can avoid having to use C<trailingData> by setting the
577
+ C<InputLength> option.
578
+
579
+ =back
580
+
581
+ =head2 OneShot Examples
582
+
583
+ To read the contents of the file C<file1.txt.Compressed> and write the
584
+ uncompressed data to the file C<file1.txt>.
585
+
586
+ use strict ;
587
+ use warnings ;
588
+ use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ;
589
+
590
+ my $input = "file1.txt.Compressed";
591
+ my $output = "file1.txt";
592
+ anyuncompress $input => $output
593
+ or die "anyuncompress failed: $AnyUncompressError\n";
594
+
595
+ To read from an existing Perl filehandle, C<$input>, and write the
596
+ uncompressed data to a buffer, C<$buffer>.
597
+
598
+ use strict ;
599
+ use warnings ;
600
+ use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ;
601
+ use IO::File ;
602
+
603
+ my $input = IO::File->new( "<file1.txt.Compressed" )
604
+ or die "Cannot open 'file1.txt.Compressed': $!\n" ;
605
+ my $buffer ;
606
+ anyuncompress $input => \$buffer
607
+ or die "anyuncompress failed: $AnyUncompressError\n";
608
+
609
+ To uncompress all files in the directory "/my/home" that match "*.txt.Compressed" and store the compressed data in the same directory
610
+
611
+ use strict ;
612
+ use warnings ;
613
+ use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ;
614
+
615
+ anyuncompress '</my/home/*.txt.Compressed>' => '</my/home/#1.txt>'
616
+ or die "anyuncompress failed: $AnyUncompressError\n";
617
+
618
+ and if you want to compress each file one at a time, this will do the trick
619
+
620
+ use strict ;
621
+ use warnings ;
622
+ use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ;
623
+
624
+ for my $input ( glob "/my/home/*.txt.Compressed" )
625
+ {
626
+ my $output = $input;
627
+ $output =~ s/.Compressed// ;
628
+ anyuncompress $input => $output
629
+ or die "Error compressing '$input': $AnyUncompressError\n";
630
+ }
631
+
632
+ =head1 OO Interface
633
+
634
+ =head2 Constructor
635
+
636
+ The format of the constructor for IO::Uncompress::AnyUncompress is shown below
637
+
638
+ my $z = IO::Uncompress::AnyUncompress->new( $input [OPTS] )
639
+ or die "IO::Uncompress::AnyUncompress failed: $AnyUncompressError\n";
640
+
641
+ The constructor takes one mandatory parameter, C<$input>, defined below, and
642
+ zero or more C<OPTS>, defined in L<Constructor Options>.
643
+
644
+ Returns an C<IO::Uncompress::AnyUncompress> object on success and undef on failure.
645
+ The variable C<$AnyUncompressError> will contain an error message on failure.
646
+
647
+ If you are running Perl 5.005 or better the object, C<$z>, returned from
648
+ IO::Uncompress::AnyUncompress can be used exactly like an L<IO::File|IO::File> filehandle.
649
+ This means that all normal input file operations can be carried out with
650
+ C<$z>. For example, to read a line from a compressed file/buffer you can
651
+ use either of these forms
652
+
653
+ $line = $z->getline();
654
+ $line = <$z>;
655
+
656
+ Below is a simple exaple of using the OO interface to read the compressed file
657
+ C<myfile.Compressed> and write its contents to stdout.
658
+
659
+ my $filename = "myfile.Compressed";
660
+ my $z = IO::Uncompress::AnyUncompress->new($filename)
661
+ or die "IO::Uncompress::AnyUncompress failed: $AnyUncompressError\n";
662
+
663
+ while (<$z>) {
664
+ print $_;
665
+ }
666
+ $z->close();
667
+
668
+ See L</EXAMPLES> for further examples
669
+
670
+ The mandatory parameter C<$input> is used to determine the source of the
671
+ compressed data. This parameter can take one of three forms.
672
+
673
+ =over 5
674
+
675
+ =item A filename
676
+
677
+ If the C<$input> parameter is a scalar, it is assumed to be a filename. This
678
+ file will be opened for reading and the compressed data will be read from it.
679
+
680
+ =item A filehandle
681
+
682
+ If the C<$input> parameter is a filehandle, the compressed data will be
683
+ read from it.
684
+ The string '-' can be used as an alias for standard input.
685
+
686
+ =item A scalar reference
687
+
688
+ If C<$input> is a scalar reference, the compressed data will be read from
689
+ C<$$input>.
690
+
691
+ =back
692
+
693
+ =head2 Constructor Options
694
+
695
+ The option names defined below are case insensitive and can be optionally
696
+ prefixed by a '-'. So all of the following are valid
697
+
698
+ -AutoClose
699
+ -autoclose
700
+ AUTOCLOSE
701
+ autoclose
702
+
703
+ OPTS is a combination of the following options:
704
+
705
+ =over 5
706
+
707
+ =item C<< AutoClose => 0|1 >>
708
+
709
+ This option is only valid when the C<$input> parameter is a filehandle. If
710
+ specified, and the value is true, it will result in the file being closed once
711
+ either the C<close> method is called or the IO::Uncompress::AnyUncompress object is
712
+ destroyed.
713
+
714
+ This parameter defaults to 0.
715
+
716
+ =item C<< MultiStream => 0|1 >>
717
+
718
+ Allows multiple concatenated compressed streams to be treated as a single
719
+ compressed stream. Decompression will stop once either the end of the
720
+ file/buffer is reached, an error is encountered (premature eof, corrupt
721
+ compressed data) or the end of a stream is not immediately followed by the
722
+ start of another stream.
723
+
724
+ This parameter defaults to 0.
725
+
726
+ =item C<< Prime => $string >>
727
+
728
+ This option will uncompress the contents of C<$string> before processing the
729
+ input file/buffer.
730
+
731
+ This option can be useful when the compressed data is embedded in another
732
+ file/data structure and it is not possible to work out where the compressed
733
+ data begins without having to read the first few bytes. If this is the
734
+ case, the uncompression can be I<primed> with these bytes using this
735
+ option.
736
+
737
+ =item C<< Transparent => 0|1 >>
738
+
739
+ If this option is set and the input file/buffer is not compressed data,
740
+ the module will allow reading of it anyway.
741
+
742
+ In addition, if the input file/buffer does contain compressed data and
743
+ there is non-compressed data immediately following it, setting this option
744
+ will make this module treat the whole file/buffer as a single data stream.
745
+
746
+ This option defaults to 1.
747
+
748
+ =item C<< BlockSize => $num >>
749
+
750
+ When reading the compressed input data, IO::Uncompress::AnyUncompress will read it in
751
+ blocks of C<$num> bytes.
752
+
753
+ This option defaults to 4096.
754
+
755
+ =item C<< InputLength => $size >>
756
+
757
+ When present this option will limit the number of compressed bytes read
758
+ from the input file/buffer to C<$size>. This option can be used in the
759
+ situation where there is useful data directly after the compressed data
760
+ stream and you know beforehand the exact length of the compressed data
761
+ stream.
762
+
763
+ This option is mostly used when reading from a filehandle, in which case
764
+ the file pointer will be left pointing to the first byte directly after the
765
+ compressed data stream.
766
+
767
+ This option defaults to off.
768
+
769
+ =item C<< Append => 0|1 >>
770
+
771
+ This option controls what the C<read> method does with uncompressed data.
772
+
773
+ If set to 1, all uncompressed data will be appended to the output parameter
774
+ of the C<read> method.
775
+
776
+ If set to 0, the contents of the output parameter of the C<read> method
777
+ will be overwritten by the uncompressed data.
778
+
779
+ Defaults to 0.
780
+
781
+ =item C<< Strict => 0|1 >>
782
+
783
+ This option controls whether the extra checks defined below are used when
784
+ carrying out the decompression. When Strict is on, the extra tests are
785
+ carried out, when Strict is off they are not.
786
+
787
+ The default for this option is off.
788
+
789
+ =item C<< RawInflate => 0|1 >>
790
+
791
+ When auto-detecting the compressed format, try to test for raw-deflate (RFC
792
+ 1951) content using the C<IO::Uncompress::RawInflate> module.
793
+
794
+ The reason this is not default behaviour is because RFC 1951 content can
795
+ only be detected by attempting to uncompress it. This process is error
796
+ prone and can result is false positives.
797
+
798
+ Defaults to 0.
799
+
800
+ =item C<< UnLzma => 0|1 >>
801
+
802
+ When auto-detecting the compressed format, try to test for lzma_alone
803
+ content using the C<IO::Uncompress::UnLzma> module.
804
+
805
+ The reason this is not default behaviour is because lzma_alone content can
806
+ only be detected by attempting to uncompress it. This process is error
807
+ prone and can result is false positives.
808
+
809
+ Defaults to 0.
810
+
811
+ =back
812
+
813
+ =head1 Methods
814
+
815
+ =head2 read
816
+
817
+ Usage is
818
+
819
+ $status = $z->read($buffer)
820
+
821
+ Reads a block of compressed data (the size of the compressed block is
822
+ determined by the C<Buffer> option in the constructor), uncompresses it and
823
+ writes any uncompressed data into C<$buffer>. If the C<Append> parameter is
824
+ set in the constructor, the uncompressed data will be appended to the
825
+ C<$buffer> parameter. Otherwise C<$buffer> will be overwritten.
826
+
827
+ Returns the number of uncompressed bytes written to C<$buffer>, zero if eof
828
+ or a negative number on error.
829
+
830
+ =head2 read
831
+
832
+ Usage is
833
+
834
+ $status = $z->read($buffer, $length)
835
+ $status = $z->read($buffer, $length, $offset)
836
+
837
+ $status = read($z, $buffer, $length)
838
+ $status = read($z, $buffer, $length, $offset)
839
+
840
+ Attempt to read C<$length> bytes of uncompressed data into C<$buffer>.
841
+
842
+ The main difference between this form of the C<read> method and the
843
+ previous one, is that this one will attempt to return I<exactly> C<$length>
844
+ bytes. The only circumstances that this function will not is if end-of-file
845
+ or an IO error is encountered.
846
+
847
+ Returns the number of uncompressed bytes written to C<$buffer>, zero if eof
848
+ or a negative number on error.
849
+
850
+ =head2 getline
851
+
852
+ Usage is
853
+
854
+ $line = $z->getline()
855
+ $line = <$z>
856
+
857
+ Reads a single line.
858
+
859
+ This method fully supports the use of the variable C<$/> (or
860
+ C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to
861
+ determine what constitutes an end of line. Paragraph mode, record mode and
862
+ file slurp mode are all supported.
863
+
864
+ =head2 getc
865
+
866
+ Usage is
867
+
868
+ $char = $z->getc()
869
+
870
+ Read a single character.
871
+
872
+ =head2 ungetc
873
+
874
+ Usage is
875
+
876
+ $char = $z->ungetc($string)
877
+
878
+ =head2 getHeaderInfo
879
+
880
+ Usage is
881
+
882
+ $hdr = $z->getHeaderInfo();
883
+ @hdrs = $z->getHeaderInfo();
884
+
885
+ This method returns either a hash reference (in scalar context) or a list
886
+ or hash references (in array context) that contains information about each
887
+ of the header fields in the compressed data stream(s).
888
+
889
+ =head2 tell
890
+
891
+ Usage is
892
+
893
+ $z->tell()
894
+ tell $z
895
+
896
+ Returns the uncompressed file offset.
897
+
898
+ =head2 eof
899
+
900
+ Usage is
901
+
902
+ $z->eof();
903
+ eof($z);
904
+
905
+ Returns true if the end of the compressed input stream has been reached.
906
+
907
+ =head2 seek
908
+
909
+ $z->seek($position, $whence);
910
+ seek($z, $position, $whence);
911
+
912
+ Provides a sub-set of the C<seek> functionality, with the restriction
913
+ that it is only legal to seek forward in the input file/buffer.
914
+ It is a fatal error to attempt to seek backward.
915
+
916
+ Note that the implementation of C<seek> in this module does not provide
917
+ true random access to a compressed file/buffer. It works by uncompressing
918
+ data from the current offset in the file/buffer until it reaches the
919
+ uncompressed offset specified in the parameters to C<seek>. For very small
920
+ files this may be acceptable behaviour. For large files it may cause an
921
+ unacceptable delay.
922
+
923
+ The C<$whence> parameter takes one the usual values, namely SEEK_SET,
924
+ SEEK_CUR or SEEK_END.
925
+
926
+ Returns 1 on success, 0 on failure.
927
+
928
+ =head2 binmode
929
+
930
+ Usage is
931
+
932
+ $z->binmode
933
+ binmode $z ;
934
+
935
+ This is a noop provided for completeness.
936
+
937
+ =head2 opened
938
+
939
+ $z->opened()
940
+
941
+ Returns true if the object currently refers to a opened file/buffer.
942
+
943
+ =head2 autoflush
944
+
945
+ my $prev = $z->autoflush()
946
+ my $prev = $z->autoflush(EXPR)
947
+
948
+ If the C<$z> object is associated with a file or a filehandle, this method
949
+ returns the current autoflush setting for the underlying filehandle. If
950
+ C<EXPR> is present, and is non-zero, it will enable flushing after every
951
+ write/print operation.
952
+
953
+ If C<$z> is associated with a buffer, this method has no effect and always
954
+ returns C<undef>.
955
+
956
+ B<Note> that the special variable C<$|> B<cannot> be used to set or
957
+ retrieve the autoflush setting.
958
+
959
+ =head2 input_line_number
960
+
961
+ $z->input_line_number()
962
+ $z->input_line_number(EXPR)
963
+
964
+ Returns the current uncompressed line number. If C<EXPR> is present it has
965
+ the effect of setting the line number. Note that setting the line number
966
+ does not change the current position within the file/buffer being read.
967
+
968
+ The contents of C<$/> are used to determine what constitutes a line
969
+ terminator.
970
+
971
+ =head2 fileno
972
+
973
+ $z->fileno()
974
+ fileno($z)
975
+
976
+ If the C<$z> object is associated with a file or a filehandle, C<fileno>
977
+ will return the underlying file descriptor. Once the C<close> method is
978
+ called C<fileno> will return C<undef>.
979
+
980
+ If the C<$z> object is associated with a buffer, this method will return
981
+ C<undef>.
982
+
983
+ =head2 close
984
+
985
+ $z->close() ;
986
+ close $z ;
987
+
988
+ Closes the output file/buffer.
989
+
990
+ For most versions of Perl this method will be automatically invoked if
991
+ the IO::Uncompress::AnyUncompress object is destroyed (either explicitly or by the
992
+ variable with the reference to the object going out of scope). The
993
+ exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In
994
+ these cases, the C<close> method will be called automatically, but
995
+ not until global destruction of all live objects when the program is
996
+ terminating.
997
+
998
+ Therefore, if you want your scripts to be able to run on all versions
999
+ of Perl, you should call C<close> explicitly and not rely on automatic
1000
+ closing.
1001
+
1002
+ Returns true on success, otherwise 0.
1003
+
1004
+ If the C<AutoClose> option has been enabled when the IO::Uncompress::AnyUncompress
1005
+ object was created, and the object is associated with a file, the
1006
+ underlying file will also be closed.
1007
+
1008
+ =head2 nextStream
1009
+
1010
+ Usage is
1011
+
1012
+ my $status = $z->nextStream();
1013
+
1014
+ Skips to the next compressed data stream in the input file/buffer. If a new
1015
+ compressed data stream is found, the eof marker will be cleared and C<$.>
1016
+ will be reset to 0.
1017
+
1018
+ Returns 1 if a new stream was found, 0 if none was found, and -1 if an
1019
+ error was encountered.
1020
+
1021
+ =head2 trailingData
1022
+
1023
+ Usage is
1024
+
1025
+ my $data = $z->trailingData();
1026
+
1027
+ Returns the data, if any, that is present immediately after the compressed
1028
+ data stream once uncompression is complete. It only makes sense to call
1029
+ this method once the end of the compressed data stream has been
1030
+ encountered.
1031
+
1032
+ This option can be used when there is useful information immediately
1033
+ following the compressed data stream, and you don't know the length of the
1034
+ compressed data stream.
1035
+
1036
+ If the input is a buffer, C<trailingData> will return everything from the
1037
+ end of the compressed data stream to the end of the buffer.
1038
+
1039
+ If the input is a filehandle, C<trailingData> will return the data that is
1040
+ left in the filehandle input buffer once the end of the compressed data
1041
+ stream has been reached. You can then use the filehandle to read the rest
1042
+ of the input file.
1043
+
1044
+ Don't bother using C<trailingData> if the input is a filename.
1045
+
1046
+ If you know the length of the compressed data stream before you start
1047
+ uncompressing, you can avoid having to use C<trailingData> by setting the
1048
+ C<InputLength> option in the constructor.
1049
+
1050
+ =head1 Importing
1051
+
1052
+ No symbolic constants are required by IO::Uncompress::AnyUncompress at present.
1053
+
1054
+ =over 5
1055
+
1056
+ =item :all
1057
+
1058
+ Imports C<anyuncompress> and C<$AnyUncompressError>.
1059
+ Same as doing this
1060
+
1061
+ use IO::Uncompress::AnyUncompress qw(anyuncompress $AnyUncompressError) ;
1062
+
1063
+ =back
1064
+
1065
+ =head1 EXAMPLES
1066
+
1067
+ =head1 SUPPORT
1068
+
1069
+ General feedback/questions/bug reports should be sent to
1070
+ L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
1071
+ L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
1072
+
1073
+ =head1 SEE ALSO
1074
+
1075
+ L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>
1076
+
1077
+ L<IO::Compress::FAQ|IO::Compress::FAQ>
1078
+
1079
+ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
1080
+ L<Archive::Tar|Archive::Tar>,
1081
+ L<IO::Zlib|IO::Zlib>
1082
+
1083
+ =head1 AUTHOR
1084
+
1085
+ This module was written by Paul Marquess, C<pmqs@cpan.org>.
1086
+
1087
+ =head1 MODIFICATION HISTORY
1088
+
1089
+ See the Changes file.
1090
+
1091
+ =head1 COPYRIGHT AND LICENSE
1092
+
1093
+ Copyright (c) 2005-2024 Paul Marquess. All rights reserved.
1094
+
1095
+ This program is free software; you can redistribute it and/or
1096
+ modify it under the same terms as Perl itself.
git/usr/share/perl5/core_perl/IO/Uncompress/Base.pm ADDED
@@ -0,0 +1,1573 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ package IO::Uncompress::Base ;
3
+
4
+ use strict ;
5
+ use warnings;
6
+ use bytes;
7
+
8
+ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
9
+ @ISA = qw(IO::File Exporter);
10
+
11
+
12
+ $VERSION = '2.213';
13
+
14
+ use constant G_EOF => 0 ;
15
+ use constant G_ERR => -1 ;
16
+
17
+ use IO::Compress::Base::Common 2.213 ;
18
+
19
+ use IO::File ;
20
+ use Symbol;
21
+ use Scalar::Util ();
22
+ use List::Util ();
23
+ use Carp ;
24
+
25
+ %EXPORT_TAGS = ( );
26
+ push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
27
+
28
+ sub smartRead
29
+ {
30
+ my $self = $_[0];
31
+ my $out = $_[1];
32
+ my $size = $_[2];
33
+ $$out = "" ;
34
+
35
+ my $offset = 0 ;
36
+ my $status = 1;
37
+
38
+
39
+ if (defined *$self->{InputLength}) {
40
+ return 0
41
+ if *$self->{InputLengthRemaining} <= 0 ;
42
+ $size = List::Util::min($size, *$self->{InputLengthRemaining});
43
+ }
44
+
45
+ if ( length *$self->{Prime} ) {
46
+ $$out = substr(*$self->{Prime}, 0, $size) ;
47
+ substr(*$self->{Prime}, 0, $size) = '' ;
48
+ if (length $$out == $size) {
49
+ *$self->{InputLengthRemaining} -= length $$out
50
+ if defined *$self->{InputLength};
51
+
52
+ return length $$out ;
53
+ }
54
+ $offset = length $$out ;
55
+ }
56
+
57
+ my $get_size = $size - $offset ;
58
+
59
+ if (defined *$self->{FH}) {
60
+ if ($offset) {
61
+ # Not using this
62
+ #
63
+ # *$self->{FH}->read($$out, $get_size, $offset);
64
+ #
65
+ # because the filehandle may not support the offset parameter
66
+ # An example is Net::FTP
67
+ my $tmp = '';
68
+ $status = *$self->{FH}->read($tmp, $get_size) ;
69
+ substr($$out, $offset) = $tmp
70
+ if defined $status && $status > 0 ;
71
+ }
72
+ else
73
+ { $status = *$self->{FH}->read($$out, $get_size) }
74
+ }
75
+ elsif (defined *$self->{InputEvent}) {
76
+ my $got = 1 ;
77
+ while (length $$out < $size) {
78
+ last
79
+ if ($got = *$self->{InputEvent}->($$out, $get_size)) <= 0;
80
+ }
81
+
82
+ if (length $$out > $size ) {
83
+ *$self->{Prime} = substr($$out, $size, length($$out));
84
+ substr($$out, $size, length($$out)) = '';
85
+ }
86
+
87
+ *$self->{EventEof} = 1 if $got <= 0 ;
88
+ }
89
+ else {
90
+ no warnings 'uninitialized';
91
+ my $buf = *$self->{Buffer} ;
92
+ $$buf = '' unless defined $$buf ;
93
+ substr($$out, $offset) = substr($$buf, *$self->{BufferOffset}, $get_size);
94
+ if (*$self->{ConsumeInput})
95
+ { substr($$buf, 0, $get_size) = '' }
96
+ else
97
+ { *$self->{BufferOffset} += length($$out) - $offset }
98
+ }
99
+
100
+ *$self->{InputLengthRemaining} -= length($$out) #- $offset
101
+ if defined *$self->{InputLength};
102
+
103
+ if (! defined $status) {
104
+ $self->saveStatus($!) ;
105
+ return STATUS_ERROR;
106
+ }
107
+
108
+ $self->saveStatus(length $$out < 0 ? STATUS_ERROR : STATUS_OK) ;
109
+
110
+ return length $$out;
111
+ }
112
+
113
+ sub pushBack
114
+ {
115
+ my $self = shift ;
116
+
117
+ return if ! defined $_[0] || length $_[0] == 0 ;
118
+
119
+ if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
120
+ *$self->{Prime} = $_[0] . *$self->{Prime} ;
121
+ *$self->{InputLengthRemaining} += length($_[0]);
122
+ }
123
+ else {
124
+ my $len = length $_[0];
125
+
126
+ if($len > *$self->{BufferOffset}) {
127
+ *$self->{Prime} = substr($_[0], 0, $len - *$self->{BufferOffset}) . *$self->{Prime} ;
128
+ *$self->{InputLengthRemaining} = *$self->{InputLength};
129
+ *$self->{BufferOffset} = 0
130
+ }
131
+ else {
132
+ *$self->{InputLengthRemaining} += length($_[0]);
133
+ *$self->{BufferOffset} -= length($_[0]) ;
134
+ }
135
+ }
136
+ }
137
+
138
+ sub smartSeek
139
+ {
140
+ my $self = shift ;
141
+ my $offset = shift ;
142
+ my $truncate = shift;
143
+ my $position = shift || SEEK_SET;
144
+
145
+ # TODO -- need to take prime into account
146
+ *$self->{Prime} = '';
147
+ if (defined *$self->{FH})
148
+ { *$self->{FH}->seek($offset, $position) }
149
+ else {
150
+ if ($position == SEEK_END) {
151
+ *$self->{BufferOffset} = length(${ *$self->{Buffer} }) + $offset ;
152
+ }
153
+ elsif ($position == SEEK_CUR) {
154
+ *$self->{BufferOffset} += $offset ;
155
+ }
156
+ else {
157
+ *$self->{BufferOffset} = $offset ;
158
+ }
159
+
160
+ substr(${ *$self->{Buffer} }, *$self->{BufferOffset}) = ''
161
+ if $truncate;
162
+ return 1;
163
+ }
164
+ }
165
+
166
+ sub smartTell
167
+ {
168
+ my $self = shift ;
169
+
170
+ if (defined *$self->{FH})
171
+ { return *$self->{FH}->tell() }
172
+ else
173
+ { return *$self->{BufferOffset} }
174
+ }
175
+
176
+ sub smartWrite
177
+ {
178
+ my $self = shift ;
179
+ my $out_data = shift ;
180
+
181
+ if (defined *$self->{FH}) {
182
+ # flush needed for 5.8.0
183
+ defined *$self->{FH}->write($out_data, length $out_data) &&
184
+ defined *$self->{FH}->flush() ;
185
+ }
186
+ else {
187
+ my $buf = *$self->{Buffer} ;
188
+ substr($$buf, *$self->{BufferOffset}, length $out_data) = $out_data ;
189
+ *$self->{BufferOffset} += length($out_data) ;
190
+ return 1;
191
+ }
192
+ }
193
+
194
+ sub smartReadExact
195
+ {
196
+ return $_[0]->smartRead($_[1], $_[2]) == $_[2];
197
+ }
198
+
199
+ sub smartEof
200
+ {
201
+ my ($self) = $_[0];
202
+ local $.;
203
+
204
+ return 0 if length *$self->{Prime} || *$self->{PushMode};
205
+
206
+ if (defined *$self->{FH})
207
+ {
208
+ # Could use
209
+ #
210
+ # *$self->{FH}->eof()
211
+ #
212
+ # here, but this can cause trouble if
213
+ # the filehandle is itself a tied handle, but it uses sysread.
214
+ # Then we get into mixing buffered & non-buffered IO,
215
+ # which will cause trouble
216
+
217
+ my $info = $self->getErrInfo();
218
+
219
+ my $buffer = '';
220
+ my $status = $self->smartRead(\$buffer, 1);
221
+ $self->pushBack($buffer) if length $buffer;
222
+ $self->setErrInfo($info);
223
+
224
+ return $status == 0 ;
225
+ }
226
+ elsif (defined *$self->{InputEvent})
227
+ { *$self->{EventEof} }
228
+ else
229
+ { *$self->{BufferOffset} >= length(${ *$self->{Buffer} }) }
230
+ }
231
+
232
+ sub clearError
233
+ {
234
+ my $self = shift ;
235
+
236
+ *$self->{ErrorNo} = 0 ;
237
+ ${ *$self->{Error} } = '' ;
238
+ }
239
+
240
+ sub getErrInfo
241
+ {
242
+ my $self = shift ;
243
+
244
+ return [ *$self->{ErrorNo}, ${ *$self->{Error} } ] ;
245
+ }
246
+
247
+ sub setErrInfo
248
+ {
249
+ my $self = shift ;
250
+ my $ref = shift;
251
+
252
+ *$self->{ErrorNo} = $ref->[0] ;
253
+ ${ *$self->{Error} } = $ref->[1] ;
254
+ }
255
+
256
+ sub saveStatus
257
+ {
258
+ my $self = shift ;
259
+ my $errno = shift() + 0 ;
260
+
261
+ *$self->{ErrorNo} = $errno;
262
+ ${ *$self->{Error} } = '' ;
263
+
264
+ return *$self->{ErrorNo} ;
265
+ }
266
+
267
+
268
+ sub saveErrorString
269
+ {
270
+ my $self = shift ;
271
+ my $retval = shift ;
272
+
273
+ ${ *$self->{Error} } = shift ;
274
+ *$self->{ErrorNo} = @_ ? shift() + 0 : STATUS_ERROR ;
275
+
276
+ return $retval;
277
+ }
278
+
279
+ sub croakError
280
+ {
281
+ my $self = shift ;
282
+ $self->saveErrorString(0, $_[0]);
283
+ croak $_[0];
284
+ }
285
+
286
+
287
+ sub closeError
288
+ {
289
+ my $self = shift ;
290
+ my $retval = shift ;
291
+
292
+ my $errno = *$self->{ErrorNo};
293
+ my $error = ${ *$self->{Error} };
294
+
295
+ $self->close();
296
+
297
+ *$self->{ErrorNo} = $errno ;
298
+ ${ *$self->{Error} } = $error ;
299
+
300
+ return $retval;
301
+ }
302
+
303
+ sub error
304
+ {
305
+ my $self = shift ;
306
+ return ${ *$self->{Error} } ;
307
+ }
308
+
309
+ sub errorNo
310
+ {
311
+ my $self = shift ;
312
+ return *$self->{ErrorNo};
313
+ }
314
+
315
+ sub HeaderError
316
+ {
317
+ my ($self) = shift;
318
+ return $self->saveErrorString(undef, "Header Error: $_[0]", STATUS_ERROR);
319
+ }
320
+
321
+ sub TrailerError
322
+ {
323
+ my ($self) = shift;
324
+ return $self->saveErrorString(G_ERR, "Trailer Error: $_[0]", STATUS_ERROR);
325
+ }
326
+
327
+ sub TruncatedHeader
328
+ {
329
+ my ($self) = shift;
330
+ return $self->HeaderError("Truncated in $_[0] Section");
331
+ }
332
+
333
+ sub TruncatedTrailer
334
+ {
335
+ my ($self) = shift;
336
+ return $self->TrailerError("Truncated in $_[0] Section");
337
+ }
338
+
339
+ sub postCheckParams
340
+ {
341
+ return 1;
342
+ }
343
+
344
+ sub checkParams
345
+ {
346
+ my $self = shift ;
347
+ my $class = shift ;
348
+
349
+ my $got = shift || IO::Compress::Base::Parameters::new();
350
+
351
+ my $Valid = {
352
+ 'blocksize' => [IO::Compress::Base::Common::Parse_unsigned, 16 * 1024],
353
+ 'autoclose' => [IO::Compress::Base::Common::Parse_boolean, 0],
354
+ 'strict' => [IO::Compress::Base::Common::Parse_boolean, 0],
355
+ 'append' => [IO::Compress::Base::Common::Parse_boolean, 0],
356
+ 'prime' => [IO::Compress::Base::Common::Parse_any, undef],
357
+ 'multistream' => [IO::Compress::Base::Common::Parse_boolean, 0],
358
+ 'transparent' => [IO::Compress::Base::Common::Parse_any, 1],
359
+ 'scan' => [IO::Compress::Base::Common::Parse_boolean, 0],
360
+ 'inputlength' => [IO::Compress::Base::Common::Parse_unsigned, undef],
361
+ 'binmodeout' => [IO::Compress::Base::Common::Parse_boolean, 0],
362
+ #'decode' => [IO::Compress::Base::Common::Parse_any, undef],
363
+
364
+ #'consumeinput' => [IO::Compress::Base::Common::Parse_boolean, 0],
365
+
366
+ $self->getExtraParams(),
367
+
368
+ #'Todo - Revert to ordinary file on end Z_STREAM_END'=> 0,
369
+ # ContinueAfterEof
370
+ } ;
371
+
372
+ $Valid->{trailingdata} = [IO::Compress::Base::Common::Parse_writable_scalar, undef]
373
+ if *$self->{OneShot} ;
374
+
375
+ $got->parse($Valid, @_ )
376
+ or $self->croakError("${class}: " . $got->getError()) ;
377
+
378
+ $self->postCheckParams($got)
379
+ or $self->croakError("${class}: " . $self->error()) ;
380
+
381
+ return $got;
382
+ }
383
+
384
+ sub _create
385
+ {
386
+ my $obj = shift;
387
+ my $got = shift;
388
+ my $append_mode = shift ;
389
+
390
+ my $class = ref $obj;
391
+ $obj->croakError("$class: Missing Input parameter")
392
+ if ! @_ && ! $got ;
393
+
394
+ my $inValue = shift ;
395
+
396
+ *$obj->{OneShot} = 0 ;
397
+
398
+ if (! $got)
399
+ {
400
+ $got = $obj->checkParams($class, undef, @_)
401
+ or return undef ;
402
+ }
403
+
404
+ my $inType = whatIsInput($inValue, 1);
405
+
406
+ $obj->ckInputParam($class, $inValue, 1)
407
+ or return undef ;
408
+
409
+ *$obj->{InNew} = 1;
410
+
411
+ $obj->ckParams($got)
412
+ or $obj->croakError("${class}: " . *$obj->{Error});
413
+
414
+ if ($inType eq 'buffer' || $inType eq 'code') {
415
+ *$obj->{Buffer} = $inValue ;
416
+ *$obj->{InputEvent} = $inValue
417
+ if $inType eq 'code' ;
418
+ }
419
+ else {
420
+ if ($inType eq 'handle') {
421
+ *$obj->{FH} = $inValue ;
422
+ *$obj->{Handle} = 1 ;
423
+
424
+ # Need to rewind for Scan
425
+ *$obj->{FH}->seek(0, SEEK_SET)
426
+ if $got->getValue('scan');
427
+ }
428
+ else {
429
+ no warnings ;
430
+ my $mode = '<';
431
+ $mode = '+<' if $got->getValue('scan');
432
+ *$obj->{StdIO} = ($inValue eq '-');
433
+ *$obj->{FH} = IO::File->new( "$mode $inValue" )
434
+ or return $obj->saveErrorString(undef, "cannot open file '$inValue': $!", $!) ;
435
+ }
436
+
437
+ *$obj->{LineNo} = $. = 0;
438
+ setBinModeInput(*$obj->{FH}) ;
439
+
440
+ my $buff = "" ;
441
+ *$obj->{Buffer} = \$buff ;
442
+ }
443
+
444
+ # if ($got->getValue('decode')) {
445
+ # my $want_encoding = $got->getValue('decode');
446
+ # *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding);
447
+ # }
448
+ # else {
449
+ # *$obj->{Encoding} = undef;
450
+ # }
451
+
452
+ *$obj->{InputLength} = $got->parsed('inputlength')
453
+ ? $got->getValue('inputlength')
454
+ : undef ;
455
+ *$obj->{InputLengthRemaining} = $got->getValue('inputlength');
456
+ *$obj->{BufferOffset} = 0 ;
457
+ *$obj->{AutoClose} = $got->getValue('autoclose');
458
+ *$obj->{Strict} = $got->getValue('strict');
459
+ *$obj->{BlockSize} = $got->getValue('blocksize');
460
+ *$obj->{Append} = $got->getValue('append');
461
+ *$obj->{AppendOutput} = $append_mode || $got->getValue('append');
462
+ *$obj->{ConsumeInput} = $got->getValue('consumeinput');
463
+ *$obj->{Transparent} = $got->getValue('transparent');
464
+ *$obj->{MultiStream} = $got->getValue('multistream');
465
+
466
+ # TODO - move these two into RawDeflate
467
+ *$obj->{Scan} = $got->getValue('scan');
468
+ *$obj->{ParseExtra} = $got->getValue('parseextra')
469
+ || $got->getValue('strict') ;
470
+ *$obj->{Type} = '';
471
+ *$obj->{Prime} = $got->getValue('prime') || '' ;
472
+ *$obj->{Pending} = '';
473
+ *$obj->{Plain} = 0;
474
+ *$obj->{PlainBytesRead} = 0;
475
+ *$obj->{InflatedBytesRead} = 0;
476
+ *$obj->{UnCompSize} = U64->new;
477
+ *$obj->{CompSize} = U64->new;
478
+ *$obj->{TotalInflatedBytesRead} = 0;
479
+ *$obj->{NewStream} = 0 ;
480
+ *$obj->{EventEof} = 0 ;
481
+ *$obj->{ClassName} = $class ;
482
+ *$obj->{Params} = $got ;
483
+
484
+ if (*$obj->{ConsumeInput}) {
485
+ *$obj->{InNew} = 0;
486
+ *$obj->{Closed} = 0;
487
+ return $obj
488
+ }
489
+
490
+ my $status = $obj->mkUncomp($got);
491
+
492
+ return undef
493
+ unless defined $status;
494
+
495
+ *$obj->{InNew} = 0;
496
+ *$obj->{Closed} = 0;
497
+
498
+ return $obj
499
+ if *$obj->{Pause} ;
500
+
501
+ if ($status) {
502
+ # Need to try uncompressing to catch the case
503
+ # where the compressed file uncompresses to an
504
+ # empty string - so eof is set immediately.
505
+
506
+ my $out_buffer = '';
507
+
508
+ $status = $obj->read(\$out_buffer);
509
+
510
+ if ($status < 0) {
511
+ *$obj->{ReadStatus} = [ $status, $obj->error(), $obj->errorNo() ];
512
+ }
513
+
514
+ $obj->ungetc($out_buffer)
515
+ if length $out_buffer;
516
+ }
517
+ else {
518
+ return undef
519
+ unless *$obj->{Transparent};
520
+
521
+ $obj->clearError();
522
+ *$obj->{Type} = 'plain';
523
+ *$obj->{Plain} = 1;
524
+ $obj->pushBack(*$obj->{HeaderPending}) ;
525
+ }
526
+
527
+ push @{ *$obj->{InfoList} }, *$obj->{Info} ;
528
+
529
+ $obj->saveStatus(STATUS_OK) ;
530
+ *$obj->{InNew} = 0;
531
+ *$obj->{Closed} = 0;
532
+
533
+ return $obj;
534
+ }
535
+
536
+ sub ckInputParam
537
+ {
538
+ my $self = shift ;
539
+ my $from = shift ;
540
+ my $inType = whatIsInput($_[0], $_[1]);
541
+
542
+ $self->croakError("$from: input parameter not a filename, filehandle, array ref or scalar ref")
543
+ if ! $inType ;
544
+
545
+ # if ($inType eq 'filename' )
546
+ # {
547
+ # return $self->saveErrorString(1, "$from: input filename is undef or null string", STATUS_ERROR)
548
+ # if ! defined $_[0] || $_[0] eq '' ;
549
+ #
550
+ # if ($_[0] ne '-' && ! -e $_[0] )
551
+ # {
552
+ # return $self->saveErrorString(1,
553
+ # "input file '$_[0]' does not exist", STATUS_ERROR);
554
+ # }
555
+ # }
556
+
557
+ return 1;
558
+ }
559
+
560
+
561
+ sub _inf
562
+ {
563
+ my $obj = shift ;
564
+
565
+ my $class = (caller)[0] ;
566
+ my $name = (caller(1))[3] ;
567
+
568
+ $obj->croakError("$name: expected at least 1 parameters\n")
569
+ unless @_ >= 1 ;
570
+
571
+ my $input = shift ;
572
+ my $haveOut = @_ ;
573
+ my $output = shift ;
574
+
575
+
576
+ my $x = IO::Compress::Base::Validator->new($class, *$obj->{Error}, $name, $input, $output)
577
+ or return undef ;
578
+
579
+ push @_, $output if $haveOut && $x->{Hash};
580
+
581
+ *$obj->{OneShot} = 1 ;
582
+
583
+ my $got = $obj->checkParams($name, undef, @_)
584
+ or return undef ;
585
+
586
+ if ($got->parsed('trailingdata'))
587
+ {
588
+ # my $value = $got->valueRef('TrailingData');
589
+ # warn "TD $value ";
590
+ # #$value = $$value;
591
+ ## warn "TD $value $$value ";
592
+ #
593
+ # return retErr($obj, "Parameter 'TrailingData' not writable")
594
+ # if readonly $$value ;
595
+ #
596
+ # if (ref $$value)
597
+ # {
598
+ # return retErr($obj,"Parameter 'TrailingData' not a scalar reference")
599
+ # if ref $$value ne 'SCALAR' ;
600
+ #
601
+ # *$obj->{TrailingData} = $$value ;
602
+ # }
603
+ # else
604
+ # {
605
+ # return retErr($obj,"Parameter 'TrailingData' not a scalar")
606
+ # if ref $value ne 'SCALAR' ;
607
+ #
608
+ # *$obj->{TrailingData} = $value ;
609
+ # }
610
+
611
+ *$obj->{TrailingData} = $got->getValue('trailingdata');
612
+ }
613
+
614
+ *$obj->{MultiStream} = $got->getValue('multistream');
615
+ $got->setValue('multistream', 0);
616
+
617
+ $x->{Got} = $got ;
618
+
619
+ # if ($x->{Hash})
620
+ # {
621
+ # while (my($k, $v) = each %$input)
622
+ # {
623
+ # $v = \$input->{$k}
624
+ # unless defined $v ;
625
+ #
626
+ # $obj->_singleTarget($x, $k, $v, @_)
627
+ # or return undef ;
628
+ # }
629
+ #
630
+ # return keys %$input ;
631
+ # }
632
+
633
+ if ($x->{GlobMap})
634
+ {
635
+ $x->{oneInput} = 1 ;
636
+ foreach my $pair (@{ $x->{Pairs} })
637
+ {
638
+ my ($from, $to) = @$pair ;
639
+ $obj->_singleTarget($x, $from, $to, @_)
640
+ or return undef ;
641
+ }
642
+
643
+ return scalar @{ $x->{Pairs} } ;
644
+ }
645
+
646
+ if (! $x->{oneOutput} )
647
+ {
648
+ my $inFile = ($x->{inType} eq 'filenames'
649
+ || $x->{inType} eq 'filename');
650
+
651
+ $x->{inType} = $inFile ? 'filename' : 'buffer';
652
+
653
+ foreach my $in ($x->{oneInput} ? $input : @$input)
654
+ {
655
+ my $out ;
656
+ $x->{oneInput} = 1 ;
657
+
658
+ $obj->_singleTarget($x, $in, $output, @_)
659
+ or return undef ;
660
+ }
661
+
662
+ return 1 ;
663
+ }
664
+
665
+ # finally the 1 to 1 and n to 1
666
+ return $obj->_singleTarget($x, $input, $output, @_);
667
+
668
+ croak "should not be here" ;
669
+ }
670
+
671
+ sub retErr
672
+ {
673
+ my $x = shift ;
674
+ my $string = shift ;
675
+
676
+ ${ $x->{Error} } = $string ;
677
+
678
+ return undef ;
679
+ }
680
+
681
+ sub _singleTarget
682
+ {
683
+ my $self = shift ;
684
+ my $x = shift ;
685
+ my $input = shift;
686
+ my $output = shift;
687
+
688
+ my $buff = '';
689
+ $x->{buff} = \$buff ;
690
+
691
+ my $fh ;
692
+ if ($x->{outType} eq 'filename') {
693
+ my $mode = '>' ;
694
+ $mode = '>>'
695
+ if $x->{Got}->getValue('append') ;
696
+ $x->{fh} = IO::File->new( "$mode $output" )
697
+ or return retErr($x, "cannot open file '$output': $!") ;
698
+ binmode $x->{fh} ;
699
+
700
+ }
701
+
702
+ elsif ($x->{outType} eq 'handle') {
703
+ $x->{fh} = $output;
704
+ binmode $x->{fh} ;
705
+ if ($x->{Got}->getValue('append')) {
706
+ seek($x->{fh}, 0, SEEK_END)
707
+ or return retErr($x, "Cannot seek to end of output filehandle: $!") ;
708
+ }
709
+ }
710
+
711
+
712
+ elsif ($x->{outType} eq 'buffer' )
713
+ {
714
+ $$output = ''
715
+ unless $x->{Got}->getValue('append');
716
+ $x->{buff} = $output ;
717
+ }
718
+
719
+ if ($x->{oneInput})
720
+ {
721
+ defined $self->_rd2($x, $input, $output)
722
+ or return undef;
723
+ }
724
+ else
725
+ {
726
+ for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input)
727
+ {
728
+ defined $self->_rd2($x, $element, $output)
729
+ or return undef ;
730
+ }
731
+ }
732
+
733
+
734
+ if ( ($x->{outType} eq 'filename' && $output ne '-') ||
735
+ ($x->{outType} eq 'handle' && $x->{Got}->getValue('autoclose'))) {
736
+ $x->{fh}->close()
737
+ or return retErr($x, $!);
738
+ delete $x->{fh};
739
+ }
740
+
741
+ return 1 ;
742
+ }
743
+
744
+ sub _rd2
745
+ {
746
+ my $self = shift ;
747
+ my $x = shift ;
748
+ my $input = shift;
749
+ my $output = shift;
750
+
751
+ my $z = IO::Compress::Base::Common::createSelfTiedObject($x->{Class}, *$self->{Error});
752
+
753
+ $z->_create($x->{Got}, 1, $input, @_)
754
+ or return undef ;
755
+
756
+ my $status ;
757
+ my $fh = $x->{fh};
758
+
759
+ while (1) {
760
+
761
+ while (($status = $z->read($x->{buff})) > 0) {
762
+ if ($fh) {
763
+ local $\;
764
+ print $fh ${ $x->{buff} }
765
+ or return $z->saveErrorString(undef, "Error writing to output file: $!", $!);
766
+ ${ $x->{buff} } = '' ;
767
+ }
768
+ }
769
+
770
+ if (! $x->{oneOutput} ) {
771
+ my $ot = $x->{outType} ;
772
+
773
+ if ($ot eq 'array')
774
+ { push @$output, $x->{buff} }
775
+ elsif ($ot eq 'hash')
776
+ { $output->{$input} = $x->{buff} }
777
+
778
+ my $buff = '';
779
+ $x->{buff} = \$buff;
780
+ }
781
+
782
+ last if $status < 0 || $z->smartEof();
783
+
784
+ last
785
+ unless *$self->{MultiStream};
786
+
787
+ $status = $z->nextStream();
788
+
789
+ last
790
+ unless $status == 1 ;
791
+ }
792
+
793
+ return $z->closeError(undef)
794
+ if $status < 0 ;
795
+
796
+ ${ *$self->{TrailingData} } = $z->trailingData()
797
+ if defined *$self->{TrailingData} ;
798
+
799
+ $z->close()
800
+ or return undef ;
801
+
802
+ return 1 ;
803
+ }
804
+
805
+ sub TIEHANDLE
806
+ {
807
+ return $_[0] if ref($_[0]);
808
+ die "OOPS\n" ;
809
+
810
+ }
811
+
812
+ sub UNTIE
813
+ {
814
+ my $self = shift ;
815
+ }
816
+
817
+
818
+ sub getHeaderInfo
819
+ {
820
+ my $self = shift ;
821
+ wantarray ? @{ *$self->{InfoList} } : *$self->{Info};
822
+ }
823
+
824
+ sub readBlock
825
+ {
826
+ my $self = shift ;
827
+ my $buff = shift ;
828
+ my $size = shift ;
829
+
830
+ if (defined *$self->{CompressedInputLength}) {
831
+ if (*$self->{CompressedInputLengthRemaining} == 0) {
832
+ delete *$self->{CompressedInputLength};
833
+ *$self->{CompressedInputLengthDone} = 1;
834
+ return STATUS_OK ;
835
+ }
836
+ $size = List::Util::min($size, *$self->{CompressedInputLengthRemaining} );
837
+ *$self->{CompressedInputLengthRemaining} -= $size ;
838
+ }
839
+
840
+ my $status = $self->smartRead($buff, $size) ;
841
+ return $self->saveErrorString(STATUS_ERROR, "Error Reading Data: $!", $!)
842
+ if $status == STATUS_ERROR ;
843
+
844
+ if ($status == 0 ) {
845
+ *$self->{Closed} = 1 ;
846
+ *$self->{EndStream} = 1 ;
847
+ return $self->saveErrorString(STATUS_ERROR, "unexpected end of file", STATUS_ERROR);
848
+ }
849
+
850
+ return STATUS_OK;
851
+ }
852
+
853
+ sub postBlockChk
854
+ {
855
+ return STATUS_OK;
856
+ }
857
+
858
+ sub _raw_read
859
+ {
860
+ # return codes
861
+ # >0 - ok, number of bytes read
862
+ # =0 - ok, eof
863
+ # <0 - not ok
864
+
865
+ my $self = shift ;
866
+
867
+ return G_EOF if *$self->{Closed} ;
868
+ return G_EOF if *$self->{EndStream} ;
869
+
870
+ my $buffer = shift ;
871
+ my $scan_mode = shift ;
872
+
873
+ if (*$self->{Plain}) {
874
+ my $tmp_buff ;
875
+ my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ;
876
+
877
+ return $self->saveErrorString(G_ERR, "Error reading data: $!", $!)
878
+ if $len == STATUS_ERROR ;
879
+
880
+ if ($len == 0 ) {
881
+ *$self->{EndStream} = 1 ;
882
+ }
883
+ else {
884
+ *$self->{PlainBytesRead} += $len ;
885
+ $$buffer .= $tmp_buff;
886
+ }
887
+
888
+ return $len ;
889
+ }
890
+
891
+ if (*$self->{NewStream}) {
892
+
893
+ $self->gotoNextStream() > 0
894
+ or return G_ERR;
895
+
896
+ # For the headers that actually uncompressed data, put the
897
+ # uncompressed data into the output buffer.
898
+ $$buffer .= *$self->{Pending} ;
899
+ my $len = length *$self->{Pending} ;
900
+ *$self->{Pending} = '';
901
+ return $len;
902
+ }
903
+
904
+ my $temp_buf = '';
905
+ my $outSize = 0;
906
+ my $status = $self->readBlock(\$temp_buf, *$self->{BlockSize}, $outSize) ;
907
+
908
+ return G_ERR
909
+ if $status == STATUS_ERROR ;
910
+
911
+ my $buf_len = 0;
912
+ if ($status == STATUS_OK) {
913
+ my $beforeC_len = length $temp_buf;
914
+ my $before_len = defined $$buffer ? length $$buffer : 0 ;
915
+ $status = *$self->{Uncomp}->uncompr(\$temp_buf, $buffer,
916
+ defined *$self->{CompressedInputLengthDone} ||
917
+ $self->smartEof(), $outSize);
918
+
919
+ # Remember the input buffer if it wasn't consumed completely
920
+ $self->pushBack($temp_buf) if *$self->{Uncomp}{ConsumesInput};
921
+
922
+ return $self->saveErrorString(G_ERR, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo})
923
+ if $self->saveStatus($status) == STATUS_ERROR;
924
+
925
+ $self->postBlockChk($buffer, $before_len) == STATUS_OK
926
+ or return G_ERR;
927
+
928
+ $buf_len = defined $$buffer ? length($$buffer) - $before_len : 0;
929
+
930
+ *$self->{CompSize}->add($beforeC_len - length $temp_buf) ;
931
+
932
+ *$self->{InflatedBytesRead} += $buf_len ;
933
+ *$self->{TotalInflatedBytesRead} += $buf_len ;
934
+ *$self->{UnCompSize}->add($buf_len) ;
935
+
936
+ $self->filterUncompressed($buffer, $before_len);
937
+
938
+ # if (*$self->{Encoding}) {
939
+ # use Encode ;
940
+ # *$self->{PendingDecode} .= substr($$buffer, $before_len) ;
941
+ # my $got = *$self->{Encoding}->decode(*$self->{PendingDecode}, Encode::FB_QUIET) ;
942
+ # substr($$buffer, $before_len) = $got;
943
+ # }
944
+ }
945
+
946
+ if ($status == STATUS_ENDSTREAM) {
947
+
948
+ *$self->{EndStream} = 1 ;
949
+
950
+ my $trailer;
951
+ my $trailer_size = *$self->{Info}{TrailerLength} ;
952
+ my $got = 0;
953
+ if (*$self->{Info}{TrailerLength})
954
+ {
955
+ $got = $self->smartRead(\$trailer, $trailer_size) ;
956
+ }
957
+
958
+ if ($got == $trailer_size) {
959
+ $self->chkTrailer($trailer) == STATUS_OK
960
+ or return G_ERR;
961
+ }
962
+ else {
963
+ return $self->TrailerError("trailer truncated. Expected " .
964
+ "$trailer_size bytes, got $got")
965
+ if *$self->{Strict};
966
+ $self->pushBack($trailer) ;
967
+ }
968
+
969
+ # TODO - if want file pointer, do it here
970
+
971
+ if (! $self->smartEof()) {
972
+ *$self->{NewStream} = 1 ;
973
+
974
+ if (*$self->{MultiStream}) {
975
+ *$self->{EndStream} = 0 ;
976
+ return $buf_len ;
977
+ }
978
+ }
979
+
980
+ }
981
+
982
+
983
+ # return the number of uncompressed bytes read
984
+ return $buf_len ;
985
+ }
986
+
987
+ sub reset
988
+ {
989
+ my $self = shift ;
990
+
991
+ return *$self->{Uncomp}->reset();
992
+ }
993
+
994
+ sub filterUncompressed
995
+ {
996
+ }
997
+
998
+ #sub isEndStream
999
+ #{
1000
+ # my $self = shift ;
1001
+ # return *$self->{NewStream} ||
1002
+ # *$self->{EndStream} ;
1003
+ #}
1004
+
1005
+ sub nextStream
1006
+ {
1007
+ my $self = shift ;
1008
+
1009
+ # An uncompressed file cannot have a next stream, so
1010
+ # return immediately.
1011
+ return 0
1012
+ if *$self->{Plain} ;
1013
+
1014
+ my $status = $self->gotoNextStream();
1015
+ $status == 1
1016
+ or return $status ;
1017
+
1018
+ *$self->{Pending} = ''
1019
+ if $self !~ /IO::Uncompress::RawInflate/ && ! *$self->{MultiStream};
1020
+
1021
+ *$self->{TotalInflatedBytesRead} = 0 ;
1022
+ *$self->{LineNo} = $. = 0;
1023
+
1024
+ return 1;
1025
+ }
1026
+
1027
+ sub gotoNextStream
1028
+ {
1029
+ my $self = shift ;
1030
+
1031
+ if (! *$self->{NewStream}) {
1032
+ my $status = 1;
1033
+ my $buffer ;
1034
+
1035
+ # TODO - make this more efficient if know the offset for the end of
1036
+ # the stream and seekable
1037
+ $status = $self->read($buffer)
1038
+ while $status > 0 ;
1039
+
1040
+ return $status
1041
+ if $status < 0;
1042
+ }
1043
+
1044
+ *$self->{NewStream} = 0 ;
1045
+ *$self->{EndStream} = 0 ;
1046
+ *$self->{CompressedInputLengthDone} = undef ;
1047
+ *$self->{CompressedInputLength} = undef ;
1048
+ $self->reset();
1049
+ *$self->{UnCompSize}->reset();
1050
+ *$self->{CompSize}->reset();
1051
+
1052
+ my $magic = $self->ckMagic();
1053
+
1054
+ if ( ! defined $magic) {
1055
+ if (! *$self->{Transparent} || $self->eof())
1056
+ {
1057
+ *$self->{EndStream} = 1 ;
1058
+ return 0;
1059
+ }
1060
+
1061
+ # Not EOF, so Transparent mode kicks in now for trailing data
1062
+ # Reset member name in case anyone calls getHeaderInfo()->{Name}
1063
+ *$self->{Info} = { Name => undef, Type => 'plain' };
1064
+
1065
+ $self->clearError();
1066
+ *$self->{Type} = 'plain';
1067
+ *$self->{Plain} = 1;
1068
+ $self->pushBack(*$self->{HeaderPending}) ;
1069
+ }
1070
+ else
1071
+ {
1072
+ *$self->{Info} = $self->readHeader($magic);
1073
+
1074
+ if ( ! defined *$self->{Info} ) {
1075
+ *$self->{EndStream} = 1 ;
1076
+ return -1;
1077
+ }
1078
+ }
1079
+
1080
+ push @{ *$self->{InfoList} }, *$self->{Info} ;
1081
+
1082
+ return 1;
1083
+ }
1084
+
1085
+ sub streamCount
1086
+ {
1087
+ my $self = shift ;
1088
+ return 1 if ! defined *$self->{InfoList};
1089
+ return scalar @{ *$self->{InfoList} } ;
1090
+ }
1091
+
1092
+ sub read
1093
+ {
1094
+ # return codes
1095
+ # >0 - ok, number of bytes read
1096
+ # =0 - ok, eof
1097
+ # <0 - not ok
1098
+
1099
+ my $self = shift ;
1100
+
1101
+ if (defined *$self->{ReadStatus} ) {
1102
+ my $status = *$self->{ReadStatus}[0];
1103
+ $self->saveErrorString( @{ *$self->{ReadStatus} } );
1104
+ delete *$self->{ReadStatus} ;
1105
+ return $status ;
1106
+ }
1107
+
1108
+ return G_EOF if *$self->{Closed} ;
1109
+
1110
+ my $buffer ;
1111
+
1112
+ if (ref $_[0] ) {
1113
+ $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
1114
+ if Scalar::Util::readonly(${ $_[0] });
1115
+
1116
+ $self->croakError(*$self->{ClassName} . "::read: not a scalar reference $_[0]" )
1117
+ unless ref $_[0] eq 'SCALAR' ;
1118
+ $buffer = $_[0] ;
1119
+ }
1120
+ else {
1121
+ $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
1122
+ if Scalar::Util::readonly($_[0]);
1123
+
1124
+ $buffer = \$_[0] ;
1125
+ }
1126
+
1127
+ my $length = $_[1] ;
1128
+ my $offset = $_[2] || 0;
1129
+
1130
+ if (! *$self->{AppendOutput}) {
1131
+ if (! $offset) {
1132
+
1133
+ $$buffer = '' ;
1134
+ }
1135
+ else {
1136
+ if ($offset > length($$buffer)) {
1137
+ $$buffer .= "\x00" x ($offset - length($$buffer));
1138
+ }
1139
+ else {
1140
+ substr($$buffer, $offset) = '';
1141
+ }
1142
+ }
1143
+ }
1144
+ elsif (! defined $$buffer) {
1145
+ $$buffer = '' ;
1146
+ }
1147
+
1148
+ return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
1149
+
1150
+ # the core read will return 0 if asked for 0 bytes
1151
+ return 0 if defined $length && $length == 0 ;
1152
+
1153
+ $length = $length || 0;
1154
+
1155
+ $self->croakError(*$self->{ClassName} . "::read: length parameter is negative")
1156
+ if $length < 0 ;
1157
+
1158
+ # Short-circuit if this is a simple read, with no length
1159
+ # or offset specified.
1160
+ unless ( $length || $offset) {
1161
+ if (length *$self->{Pending}) {
1162
+ $$buffer .= *$self->{Pending} ;
1163
+ my $len = length *$self->{Pending};
1164
+ *$self->{Pending} = '' ;
1165
+ return $len ;
1166
+ }
1167
+ else {
1168
+ my $len = 0;
1169
+ $len = $self->_raw_read($buffer)
1170
+ while ! *$self->{EndStream} && $len == 0 ;
1171
+ return $len ;
1172
+ }
1173
+ }
1174
+
1175
+ # Need to jump through more hoops - either length or offset
1176
+ # or both are specified.
1177
+ my $out_buffer = *$self->{Pending} ;
1178
+ *$self->{Pending} = '';
1179
+
1180
+
1181
+ while (! *$self->{EndStream} && length($out_buffer) < $length)
1182
+ {
1183
+ my $buf_len = $self->_raw_read(\$out_buffer);
1184
+ return $buf_len
1185
+ if $buf_len < 0 ;
1186
+ }
1187
+
1188
+ $length = length $out_buffer
1189
+ if length($out_buffer) < $length ;
1190
+
1191
+ return 0
1192
+ if $length == 0 ;
1193
+
1194
+ $$buffer = ''
1195
+ if ! defined $$buffer;
1196
+
1197
+ $offset = length $$buffer
1198
+ if *$self->{AppendOutput} ;
1199
+
1200
+ *$self->{Pending} = $out_buffer;
1201
+ $out_buffer = \*$self->{Pending} ;
1202
+
1203
+ substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ;
1204
+ substr($$out_buffer, 0, $length) = '' ;
1205
+
1206
+ return $length ;
1207
+ }
1208
+
1209
+ sub _getline
1210
+ {
1211
+ my $self = shift ;
1212
+ my $status = 0 ;
1213
+
1214
+ # Slurp Mode
1215
+ if ( ! defined $/ ) {
1216
+ my $data ;
1217
+ 1 while ($status = $self->read($data)) > 0 ;
1218
+ return ($status, \$data);
1219
+ }
1220
+
1221
+ # Record Mode
1222
+ if ( ref $/ eq 'SCALAR' && ${$/} =~ /^\d+$/ && ${$/} > 0) {
1223
+ my $reclen = ${$/} ;
1224
+ my $data ;
1225
+ $status = $self->read($data, $reclen) ;
1226
+ return ($status, \$data);
1227
+ }
1228
+
1229
+ # Paragraph Mode
1230
+ if ( ! length $/ ) {
1231
+ my $paragraph ;
1232
+ while (($status = $self->read($paragraph)) > 0 ) {
1233
+ if ($paragraph =~ s/^(.*?\n\n+)//s) {
1234
+ *$self->{Pending} = $paragraph ;
1235
+ my $par = $1 ;
1236
+ return (1, \$par);
1237
+ }
1238
+ }
1239
+ return ($status, \$paragraph);
1240
+ }
1241
+
1242
+ # $/ isn't empty, or a reference, so it's Line Mode.
1243
+ {
1244
+ my $line ;
1245
+ my $p = \*$self->{Pending} ;
1246
+ while (($status = $self->read($line)) > 0 ) {
1247
+ my $offset = index($line, $/);
1248
+ if ($offset >= 0) {
1249
+ my $l = substr($line, 0, $offset + length $/ );
1250
+ substr($line, 0, $offset + length $/) = '';
1251
+ $$p = $line;
1252
+ return (1, \$l);
1253
+ }
1254
+ }
1255
+
1256
+ return ($status, \$line);
1257
+ }
1258
+ }
1259
+
1260
+ sub getline
1261
+ {
1262
+ my $self = shift;
1263
+
1264
+ if (defined *$self->{ReadStatus} ) {
1265
+ $self->saveErrorString( @{ *$self->{ReadStatus} } );
1266
+ delete *$self->{ReadStatus} ;
1267
+ return undef;
1268
+ }
1269
+
1270
+ return undef
1271
+ if *$self->{Closed} || (!length *$self->{Pending} && *$self->{EndStream}) ;
1272
+
1273
+ my $current_append = *$self->{AppendOutput} ;
1274
+ *$self->{AppendOutput} = 1;
1275
+
1276
+ my ($status, $lineref) = $self->_getline();
1277
+ *$self->{AppendOutput} = $current_append;
1278
+
1279
+ return undef
1280
+ if $status < 0 || length $$lineref == 0 ;
1281
+
1282
+ $. = ++ *$self->{LineNo} ;
1283
+
1284
+ return $$lineref ;
1285
+ }
1286
+
1287
+ sub getlines
1288
+ {
1289
+ my $self = shift;
1290
+ $self->croakError(*$self->{ClassName} .
1291
+ "::getlines: called in scalar context\n") unless wantarray;
1292
+ my($line, @lines);
1293
+ push(@lines, $line)
1294
+ while defined($line = $self->getline);
1295
+ return @lines;
1296
+ }
1297
+
1298
+ sub READLINE
1299
+ {
1300
+ goto &getlines if wantarray;
1301
+ goto &getline;
1302
+ }
1303
+
1304
+ sub getc
1305
+ {
1306
+ my $self = shift;
1307
+ my $buf;
1308
+ return $buf if $self->read($buf, 1);
1309
+ return undef;
1310
+ }
1311
+
1312
+ sub ungetc
1313
+ {
1314
+ my $self = shift;
1315
+ *$self->{Pending} = "" unless defined *$self->{Pending} ;
1316
+ *$self->{Pending} = $_[0] . *$self->{Pending} ;
1317
+ }
1318
+
1319
+
1320
+ sub trailingData
1321
+ {
1322
+ my $self = shift ;
1323
+
1324
+ if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
1325
+ return *$self->{Prime} ;
1326
+ }
1327
+ else {
1328
+ my $buf = *$self->{Buffer} ;
1329
+ my $offset = *$self->{BufferOffset} ;
1330
+ return substr($$buf, $offset) ;
1331
+ }
1332
+ }
1333
+
1334
+
1335
+ sub eof
1336
+ {
1337
+ my $self = shift ;
1338
+
1339
+ return (*$self->{Closed} ||
1340
+ (!length *$self->{Pending}
1341
+ && ( $self->smartEof() || *$self->{EndStream}))) ;
1342
+ }
1343
+
1344
+ sub tell
1345
+ {
1346
+ my $self = shift ;
1347
+
1348
+ my $in ;
1349
+ if (*$self->{Plain}) {
1350
+ $in = *$self->{PlainBytesRead} ;
1351
+ }
1352
+ else {
1353
+ $in = *$self->{TotalInflatedBytesRead} ;
1354
+ }
1355
+
1356
+ my $pending = length *$self->{Pending} ;
1357
+
1358
+ return 0 if $pending > $in ;
1359
+ return $in - $pending ;
1360
+ }
1361
+
1362
+ sub close
1363
+ {
1364
+ # todo - what to do if close is called before the end of the gzip file
1365
+ # do we remember any trailing data?
1366
+ my $self = shift ;
1367
+
1368
+ return 1 if *$self->{Closed} ;
1369
+
1370
+ untie *$self
1371
+ if $] >= 5.008 ;
1372
+
1373
+ my $status = 1 ;
1374
+
1375
+ if (defined *$self->{FH}) {
1376
+ if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) {
1377
+ local $.;
1378
+ $! = 0 ;
1379
+ $status = *$self->{FH}->close();
1380
+ return $self->saveErrorString(0, $!, $!)
1381
+ if !*$self->{InNew} && $self->saveStatus($!) != 0 ;
1382
+ }
1383
+ delete *$self->{FH} ;
1384
+ $! = 0 ;
1385
+ }
1386
+ *$self->{Closed} = 1 ;
1387
+
1388
+ return 1;
1389
+ }
1390
+
1391
+ sub DESTROY
1392
+ {
1393
+ my $self = shift ;
1394
+ local ($., $@, $!, $^E, $?);
1395
+
1396
+ $self->close() ;
1397
+ }
1398
+
1399
+ sub seek
1400
+ {
1401
+ my $self = shift ;
1402
+ my $position = shift;
1403
+ my $whence = shift ;
1404
+
1405
+ my $here = $self->tell() ;
1406
+ my $target = 0 ;
1407
+
1408
+
1409
+ if ($whence == SEEK_SET) {
1410
+ $target = $position ;
1411
+ }
1412
+ elsif ($whence == SEEK_CUR) {
1413
+ $target = $here + $position ;
1414
+ }
1415
+ elsif ($whence == SEEK_END) {
1416
+ $target = $position ;
1417
+ $self->croakError(*$self->{ClassName} . "::seek: SEEK_END not allowed") ;
1418
+ }
1419
+ else {
1420
+ $self->croakError(*$self->{ClassName} ."::seek: unknown value, $whence, for whence parameter");
1421
+ }
1422
+
1423
+ # short circuit if seeking to current offset
1424
+ if ($target == $here) {
1425
+ # On ordinary filehandles, seeking to the current
1426
+ # position also clears the EOF condition, so we
1427
+ # emulate this behavior locally while simultaneously
1428
+ # cascading it to the underlying filehandle
1429
+ if (*$self->{Plain}) {
1430
+ *$self->{EndStream} = 0;
1431
+ seek(*$self->{FH},0,1) if *$self->{FH};
1432
+ }
1433
+ return 1;
1434
+ }
1435
+
1436
+ # Outlaw any attempt to seek backwards
1437
+ $self->croakError( *$self->{ClassName} ."::seek: cannot seek backwards")
1438
+ if $target < $here ;
1439
+
1440
+ # Walk the file to the new offset
1441
+ my $offset = $target - $here ;
1442
+
1443
+ my $got;
1444
+ while (($got = $self->read(my $buffer, List::Util::min($offset, *$self->{BlockSize})) ) > 0)
1445
+ {
1446
+ $offset -= $got;
1447
+ last if $offset == 0 ;
1448
+ }
1449
+
1450
+ $here = $self->tell() ;
1451
+ return $offset == 0 ? 1 : 0 ;
1452
+ }
1453
+
1454
+ sub fileno
1455
+ {
1456
+ my $self = shift ;
1457
+ return defined *$self->{FH}
1458
+ ? fileno *$self->{FH}
1459
+ : undef ;
1460
+ }
1461
+
1462
+ sub binmode
1463
+ {
1464
+ 1;
1465
+ # my $self = shift ;
1466
+ # return defined *$self->{FH}
1467
+ # ? binmode *$self->{FH}
1468
+ # : 1 ;
1469
+ }
1470
+
1471
+ sub opened
1472
+ {
1473
+ my $self = shift ;
1474
+ return ! *$self->{Closed} ;
1475
+ }
1476
+
1477
+ sub autoflush
1478
+ {
1479
+ my $self = shift ;
1480
+ return defined *$self->{FH}
1481
+ ? *$self->{FH}->autoflush(@_)
1482
+ : undef ;
1483
+ }
1484
+
1485
+ sub input_line_number
1486
+ {
1487
+ my $self = shift ;
1488
+ my $last = *$self->{LineNo};
1489
+ $. = *$self->{LineNo} = $_[1] if @_ ;
1490
+ return $last;
1491
+ }
1492
+
1493
+ sub _notAvailable
1494
+ {
1495
+ my $name = shift ;
1496
+ return sub { croak "$name Not Available: File opened only for intput" ; } ;
1497
+ }
1498
+
1499
+ {
1500
+ no warnings 'once';
1501
+
1502
+ *BINMODE = \&binmode;
1503
+ *SEEK = \&seek;
1504
+ *READ = \&read;
1505
+ *sysread = \&read;
1506
+ *TELL = \&tell;
1507
+ *EOF = \&eof;
1508
+
1509
+ *FILENO = \&fileno;
1510
+ *CLOSE = \&close;
1511
+
1512
+ *print = _notAvailable('print');
1513
+ *PRINT = _notAvailable('print');
1514
+ *printf = _notAvailable('printf');
1515
+ *PRINTF = _notAvailable('printf');
1516
+ *write = _notAvailable('write');
1517
+ *WRITE = _notAvailable('write');
1518
+
1519
+ #*sysread = \&read;
1520
+ #*syswrite = \&_notAvailable;
1521
+ }
1522
+
1523
+
1524
+
1525
+ package IO::Uncompress::Base ;
1526
+
1527
+
1528
+ 1 ;
1529
+ __END__
1530
+
1531
+ =head1 NAME
1532
+
1533
+ IO::Uncompress::Base - Base Class for IO::Uncompress modules
1534
+
1535
+ =head1 SYNOPSIS
1536
+
1537
+ use IO::Uncompress::Base ;
1538
+
1539
+ =head1 DESCRIPTION
1540
+
1541
+ This module is not intended for direct use in application code. Its sole
1542
+ purpose is to be sub-classed by IO::Uncompress modules.
1543
+
1544
+ =head1 SUPPORT
1545
+
1546
+ General feedback/questions/bug reports should be sent to
1547
+ L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
1548
+ L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
1549
+
1550
+ =head1 SEE ALSO
1551
+
1552
+ L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
1553
+
1554
+ L<IO::Compress::FAQ|IO::Compress::FAQ>
1555
+
1556
+ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
1557
+ L<Archive::Tar|Archive::Tar>,
1558
+ L<IO::Zlib|IO::Zlib>
1559
+
1560
+ =head1 AUTHOR
1561
+
1562
+ This module was written by Paul Marquess, C<pmqs@cpan.org>.
1563
+
1564
+ =head1 MODIFICATION HISTORY
1565
+
1566
+ See the Changes file.
1567
+
1568
+ =head1 COPYRIGHT AND LICENSE
1569
+
1570
+ Copyright (c) 2005-2024 Paul Marquess. All rights reserved.
1571
+
1572
+ This program is free software; you can redistribute it and/or
1573
+ modify it under the same terms as Perl itself.
git/usr/share/perl5/core_perl/IO/Uncompress/Bunzip2.pm ADDED
@@ -0,0 +1,928 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package IO::Uncompress::Bunzip2 ;
2
+
3
+ use strict ;
4
+ use warnings;
5
+ use bytes;
6
+
7
+ use IO::Compress::Base::Common 2.213 qw(:Status );
8
+
9
+ use IO::Uncompress::Base 2.213 ;
10
+ use IO::Uncompress::Adapter::Bunzip2 2.213 ;
11
+
12
+ require Exporter ;
13
+ our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error);
14
+
15
+ $VERSION = '2.213';
16
+ $Bunzip2Error = '';
17
+
18
+ @ISA = qw(IO::Uncompress::Base Exporter);
19
+ @EXPORT_OK = qw( $Bunzip2Error bunzip2 ) ;
20
+ #%EXPORT_TAGS = %IO::Uncompress::Base::EXPORT_TAGS ;
21
+ push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
22
+ #Exporter::export_ok_tags('all');
23
+
24
+
25
+ sub new
26
+ {
27
+ my $class = shift ;
28
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bunzip2Error);
29
+
30
+ $obj->_create(undef, 0, @_);
31
+ }
32
+
33
+ sub bunzip2
34
+ {
35
+ my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bunzip2Error);
36
+ return $obj->_inf(@_);
37
+ }
38
+
39
+ sub getExtraParams
40
+ {
41
+ return (
42
+ 'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0],
43
+ 'small' => [IO::Compress::Base::Common::Parse_boolean, 0],
44
+ );
45
+ }
46
+
47
+
48
+ sub ckParams
49
+ {
50
+ my $self = shift ;
51
+ my $got = shift ;
52
+
53
+ return 1;
54
+ }
55
+
56
+ sub mkUncomp
57
+ {
58
+ my $self = shift ;
59
+ my $got = shift ;
60
+
61
+ my $magic = $self->ckMagic()
62
+ or return 0;
63
+
64
+ *$self->{Info} = $self->readHeader($magic)
65
+ or return undef ;
66
+
67
+ my $Small = $got->getValue('small');
68
+ my $Verbosity = $got->getValue('verbosity');
69
+
70
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Bunzip2::mkUncompObject(
71
+ $Small, $Verbosity);
72
+
73
+ return $self->saveErrorString(undef, $errstr, $errno)
74
+ if ! defined $obj;
75
+
76
+ *$self->{Uncomp} = $obj;
77
+
78
+ return 1;
79
+
80
+ }
81
+
82
+
83
+ sub ckMagic
84
+ {
85
+ my $self = shift;
86
+
87
+ my $magic ;
88
+ $self->smartReadExact(\$magic, 4);
89
+
90
+ *$self->{HeaderPending} = $magic ;
91
+
92
+ return $self->HeaderError("Header size is " .
93
+ 4 . " bytes")
94
+ if length $magic != 4;
95
+
96
+ return $self->HeaderError("Bad Magic.")
97
+ if ! isBzip2Magic($magic) ;
98
+
99
+
100
+ *$self->{Type} = 'bzip2';
101
+ return $magic;
102
+ }
103
+
104
+ sub readHeader
105
+ {
106
+ my $self = shift;
107
+ my $magic = shift ;
108
+
109
+ $self->pushBack($magic);
110
+ *$self->{HeaderPending} = '';
111
+
112
+
113
+ return {
114
+ 'Type' => 'bzip2',
115
+ 'FingerprintLength' => 4,
116
+ 'HeaderLength' => 4,
117
+ 'TrailerLength' => 0,
118
+ 'Header' => '$magic'
119
+ };
120
+
121
+ }
122
+
123
+ sub chkTrailer
124
+ {
125
+ return STATUS_OK;
126
+ }
127
+
128
+
129
+
130
+ sub isBzip2Magic
131
+ {
132
+ my $buffer = shift ;
133
+
134
+ # ASCII: B Z h 0 9
135
+ return $buffer =~ qr/^\x42\x5A\x68[\x30-\x39]$/;
136
+ }
137
+
138
+ 1 ;
139
+
140
+ __END__
141
+
142
+
143
+ =head1 NAME
144
+
145
+ IO::Uncompress::Bunzip2 - Read bzip2 files/buffers
146
+
147
+ =head1 SYNOPSIS
148
+
149
+ use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ;
150
+
151
+ my $status = bunzip2 $input => $output [,OPTS]
152
+ or die "bunzip2 failed: $Bunzip2Error\n";
153
+
154
+ my $z = IO::Uncompress::Bunzip2->new( $input [OPTS] )
155
+ or die "bunzip2 failed: $Bunzip2Error\n";
156
+
157
+ $status = $z->read($buffer)
158
+ $status = $z->read($buffer, $length)
159
+ $status = $z->read($buffer, $length, $offset)
160
+ $line = $z->getline()
161
+ $char = $z->getc()
162
+ $char = $z->ungetc()
163
+ $char = $z->opened()
164
+
165
+ $data = $z->trailingData()
166
+ $status = $z->nextStream()
167
+ $data = $z->getHeaderInfo()
168
+ $z->tell()
169
+ $z->seek($position, $whence)
170
+ $z->binmode()
171
+ $z->fileno()
172
+ $z->eof()
173
+ $z->close()
174
+
175
+ $Bunzip2Error ;
176
+
177
+ # IO::File mode
178
+
179
+ <$z>
180
+ read($z, $buffer);
181
+ read($z, $buffer, $length);
182
+ read($z, $buffer, $length, $offset);
183
+ tell($z)
184
+ seek($z, $position, $whence)
185
+ binmode($z)
186
+ fileno($z)
187
+ eof($z)
188
+ close($z)
189
+
190
+ =head1 DESCRIPTION
191
+
192
+ This module provides a Perl interface that allows the reading of
193
+ bzip2 files/buffers.
194
+
195
+ For writing bzip2 files/buffers, see the companion module IO::Compress::Bzip2.
196
+
197
+ =head1 Functional Interface
198
+
199
+ A top-level function, C<bunzip2>, is provided to carry out
200
+ "one-shot" uncompression between buffers and/or files. For finer
201
+ control over the uncompression process, see the L</"OO Interface">
202
+ section.
203
+
204
+ use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ;
205
+
206
+ bunzip2 $input_filename_or_reference => $output_filename_or_reference [,OPTS]
207
+ or die "bunzip2 failed: $Bunzip2Error\n";
208
+
209
+ The functional interface needs Perl5.005 or better.
210
+
211
+ =head2 bunzip2 $input_filename_or_reference => $output_filename_or_reference [, OPTS]
212
+
213
+ C<bunzip2> expects at least two parameters,
214
+ C<$input_filename_or_reference> and C<$output_filename_or_reference>
215
+ and zero or more optional parameters (see L</Optional Parameters>)
216
+
217
+ =head3 The C<$input_filename_or_reference> parameter
218
+
219
+ The parameter, C<$input_filename_or_reference>, is used to define the
220
+ source of the compressed data.
221
+
222
+ It can take one of the following forms:
223
+
224
+ =over 5
225
+
226
+ =item A filename
227
+
228
+ If the C<$input_filename_or_reference> parameter is a simple scalar, it is
229
+ assumed to be a filename. This file will be opened for reading and the
230
+ input data will be read from it.
231
+
232
+ =item A filehandle
233
+
234
+ If the C<$input_filename_or_reference> parameter is a filehandle, the input
235
+ data will be read from it. The string '-' can be used as an alias for
236
+ standard input.
237
+
238
+ =item A scalar reference
239
+
240
+ If C<$input_filename_or_reference> is a scalar reference, the input data
241
+ will be read from C<$$input_filename_or_reference>.
242
+
243
+ =item An array reference
244
+
245
+ If C<$input_filename_or_reference> is an array reference, each element in
246
+ the array must be a filename.
247
+
248
+ The input data will be read from each file in turn.
249
+
250
+ The complete array will be walked to ensure that it only
251
+ contains valid filenames before any data is uncompressed.
252
+
253
+ =item An Input FileGlob string
254
+
255
+ If C<$input_filename_or_reference> is a string that is delimited by the
256
+ characters "<" and ">" C<bunzip2> will assume that it is an
257
+ I<input fileglob string>. The input is the list of files that match the
258
+ fileglob.
259
+
260
+ See L<File::GlobMapper|File::GlobMapper> for more details.
261
+
262
+ =back
263
+
264
+ If the C<$input_filename_or_reference> parameter is any other type,
265
+ C<undef> will be returned.
266
+
267
+ =head3 The C<$output_filename_or_reference> parameter
268
+
269
+ The parameter C<$output_filename_or_reference> is used to control the
270
+ destination of the uncompressed data. This parameter can take one of
271
+ these forms.
272
+
273
+ =over 5
274
+
275
+ =item A filename
276
+
277
+ If the C<$output_filename_or_reference> parameter is a simple scalar, it is
278
+ assumed to be a filename. This file will be opened for writing and the
279
+ uncompressed data will be written to it.
280
+
281
+ =item A filehandle
282
+
283
+ If the C<$output_filename_or_reference> parameter is a filehandle, the
284
+ uncompressed data will be written to it. The string '-' can be used as
285
+ an alias for standard output.
286
+
287
+ =item A scalar reference
288
+
289
+ If C<$output_filename_or_reference> is a scalar reference, the
290
+ uncompressed data will be stored in C<$$output_filename_or_reference>.
291
+
292
+ =item An Array Reference
293
+
294
+ If C<$output_filename_or_reference> is an array reference,
295
+ the uncompressed data will be pushed onto the array.
296
+
297
+ =item An Output FileGlob
298
+
299
+ If C<$output_filename_or_reference> is a string that is delimited by the
300
+ characters "<" and ">" C<bunzip2> will assume that it is an
301
+ I<output fileglob string>. The output is the list of files that match the
302
+ fileglob.
303
+
304
+ When C<$output_filename_or_reference> is an fileglob string,
305
+ C<$input_filename_or_reference> must also be a fileglob string. Anything
306
+ else is an error.
307
+
308
+ See L<File::GlobMapper|File::GlobMapper> for more details.
309
+
310
+ =back
311
+
312
+ If the C<$output_filename_or_reference> parameter is any other type,
313
+ C<undef> will be returned.
314
+
315
+ =head2 Notes
316
+
317
+ When C<$input_filename_or_reference> maps to multiple compressed
318
+ files/buffers and C<$output_filename_or_reference> is
319
+ a single file/buffer, after uncompression C<$output_filename_or_reference> will contain a
320
+ concatenation of all the uncompressed data from each of the input
321
+ files/buffers.
322
+
323
+ =head2 Optional Parameters
324
+
325
+ The optional parameters for the one-shot function C<bunzip2>
326
+ are (for the most part) identical to those used with the OO interface defined in the
327
+ L</"Constructor Options"> section. The exceptions are listed below
328
+
329
+ =over 5
330
+
331
+ =item C<< AutoClose => 0|1 >>
332
+
333
+ This option applies to any input or output data streams to
334
+ C<bunzip2> that are filehandles.
335
+
336
+ If C<AutoClose> is specified, and the value is true, it will result in all
337
+ input and/or output filehandles being closed once C<bunzip2> has
338
+ completed.
339
+
340
+ This parameter defaults to 0.
341
+
342
+ =item C<< BinModeOut => 0|1 >>
343
+
344
+ This option is now a no-op. All files will be written in binmode.
345
+
346
+ =item C<< Append => 0|1 >>
347
+
348
+ The behaviour of this option is dependent on the type of output data
349
+ stream.
350
+
351
+ =over 5
352
+
353
+ =item * A Buffer
354
+
355
+ If C<Append> is enabled, all uncompressed data will be append to the end of
356
+ the output buffer. Otherwise the output buffer will be cleared before any
357
+ uncompressed data is written to it.
358
+
359
+ =item * A Filename
360
+
361
+ If C<Append> is enabled, the file will be opened in append mode. Otherwise
362
+ the contents of the file, if any, will be truncated before any uncompressed
363
+ data is written to it.
364
+
365
+ =item * A Filehandle
366
+
367
+ If C<Append> is enabled, the filehandle will be positioned to the end of
368
+ the file via a call to C<seek> before any uncompressed data is
369
+ written to it. Otherwise the file pointer will not be moved.
370
+
371
+ =back
372
+
373
+ When C<Append> is specified, and set to true, it will I<append> all uncompressed
374
+ data to the output data stream.
375
+
376
+ So when the output is a filehandle it will carry out a seek to the eof
377
+ before writing any uncompressed data. If the output is a filename, it will be opened for
378
+ appending. If the output is a buffer, all uncompressed data will be
379
+ appended to the existing buffer.
380
+
381
+ Conversely when C<Append> is not specified, or it is present and is set to
382
+ false, it will operate as follows.
383
+
384
+ When the output is a filename, it will truncate the contents of the file
385
+ before writing any uncompressed data. If the output is a filehandle
386
+ its position will not be changed. If the output is a buffer, it will be
387
+ wiped before any uncompressed data is output.
388
+
389
+ Defaults to 0.
390
+
391
+ =item C<< MultiStream => 0|1 >>
392
+
393
+ If the input file/buffer contains multiple compressed data streams, this
394
+ option will uncompress the whole lot as a single data stream.
395
+
396
+ Defaults to 0.
397
+
398
+ =item C<< TrailingData => $scalar >>
399
+
400
+ Returns the data, if any, that is present immediately after the compressed
401
+ data stream once uncompression is complete.
402
+
403
+ This option can be used when there is useful information immediately
404
+ following the compressed data stream, and you don't know the length of the
405
+ compressed data stream.
406
+
407
+ If the input is a buffer, C<trailingData> will return everything from the
408
+ end of the compressed data stream to the end of the buffer.
409
+
410
+ If the input is a filehandle, C<trailingData> will return the data that is
411
+ left in the filehandle input buffer once the end of the compressed data
412
+ stream has been reached. You can then use the filehandle to read the rest
413
+ of the input file.
414
+
415
+ Don't bother using C<trailingData> if the input is a filename.
416
+
417
+ If you know the length of the compressed data stream before you start
418
+ uncompressing, you can avoid having to use C<trailingData> by setting the
419
+ C<InputLength> option.
420
+
421
+ =back
422
+
423
+ =head2 OneShot Examples
424
+
425
+ To read the contents of the file C<file1.txt.bz2> and write the
426
+ uncompressed data to the file C<file1.txt>.
427
+
428
+ use strict ;
429
+ use warnings ;
430
+ use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ;
431
+
432
+ my $input = "file1.txt.bz2";
433
+ my $output = "file1.txt";
434
+ bunzip2 $input => $output
435
+ or die "bunzip2 failed: $Bunzip2Error\n";
436
+
437
+ To read from an existing Perl filehandle, C<$input>, and write the
438
+ uncompressed data to a buffer, C<$buffer>.
439
+
440
+ use strict ;
441
+ use warnings ;
442
+ use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ;
443
+ use IO::File ;
444
+
445
+ my $input = IO::File->new( "<file1.txt.bz2" )
446
+ or die "Cannot open 'file1.txt.bz2': $!\n" ;
447
+ my $buffer ;
448
+ bunzip2 $input => \$buffer
449
+ or die "bunzip2 failed: $Bunzip2Error\n";
450
+
451
+ To uncompress all files in the directory "/my/home" that match "*.txt.bz2" and store the compressed data in the same directory
452
+
453
+ use strict ;
454
+ use warnings ;
455
+ use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ;
456
+
457
+ bunzip2 '</my/home/*.txt.bz2>' => '</my/home/#1.txt>'
458
+ or die "bunzip2 failed: $Bunzip2Error\n";
459
+
460
+ and if you want to compress each file one at a time, this will do the trick
461
+
462
+ use strict ;
463
+ use warnings ;
464
+ use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ;
465
+
466
+ for my $input ( glob "/my/home/*.txt.bz2" )
467
+ {
468
+ my $output = $input;
469
+ $output =~ s/.bz2// ;
470
+ bunzip2 $input => $output
471
+ or die "Error compressing '$input': $Bunzip2Error\n";
472
+ }
473
+
474
+ =head1 OO Interface
475
+
476
+ =head2 Constructor
477
+
478
+ The format of the constructor for IO::Uncompress::Bunzip2 is shown below
479
+
480
+ my $z = IO::Uncompress::Bunzip2->new( $input [OPTS] )
481
+ or die "IO::Uncompress::Bunzip2 failed: $Bunzip2Error\n";
482
+
483
+ The constructor takes one mandatory parameter, C<$input>, defined below, and
484
+ zero or more C<OPTS>, defined in L<Constructor Options>.
485
+
486
+ Returns an C<IO::Uncompress::Bunzip2> object on success and undef on failure.
487
+ The variable C<$Bunzip2Error> will contain an error message on failure.
488
+
489
+ If you are running Perl 5.005 or better the object, C<$z>, returned from
490
+ IO::Uncompress::Bunzip2 can be used exactly like an L<IO::File|IO::File> filehandle.
491
+ This means that all normal input file operations can be carried out with
492
+ C<$z>. For example, to read a line from a compressed file/buffer you can
493
+ use either of these forms
494
+
495
+ $line = $z->getline();
496
+ $line = <$z>;
497
+
498
+ Below is a simple exaple of using the OO interface to read the compressed file
499
+ C<myfile.bz2> and write its contents to stdout.
500
+
501
+ my $filename = "myfile.bz2";
502
+ my $z = IO::Uncompress::Bunzip2->new($filename)
503
+ or die "IO::Uncompress::Bunzip2 failed: $Bunzip2Error\n";
504
+
505
+ while (<$z>) {
506
+ print $_;
507
+ }
508
+ $z->close();
509
+
510
+ See L</EXAMPLES> for further examples
511
+
512
+ The mandatory parameter C<$input> is used to determine the source of the
513
+ compressed data. This parameter can take one of three forms.
514
+
515
+ =over 5
516
+
517
+ =item A filename
518
+
519
+ If the C<$input> parameter is a scalar, it is assumed to be a filename. This
520
+ file will be opened for reading and the compressed data will be read from it.
521
+
522
+ =item A filehandle
523
+
524
+ If the C<$input> parameter is a filehandle, the compressed data will be
525
+ read from it.
526
+ The string '-' can be used as an alias for standard input.
527
+
528
+ =item A scalar reference
529
+
530
+ If C<$input> is a scalar reference, the compressed data will be read from
531
+ C<$$input>.
532
+
533
+ =back
534
+
535
+ =head2 Constructor Options
536
+
537
+ The option names defined below are case insensitive and can be optionally
538
+ prefixed by a '-'. So all of the following are valid
539
+
540
+ -AutoClose
541
+ -autoclose
542
+ AUTOCLOSE
543
+ autoclose
544
+
545
+ OPTS is a combination of the following options:
546
+
547
+ =over 5
548
+
549
+ =item C<< AutoClose => 0|1 >>
550
+
551
+ This option is only valid when the C<$input> parameter is a filehandle. If
552
+ specified, and the value is true, it will result in the file being closed once
553
+ either the C<close> method is called or the IO::Uncompress::Bunzip2 object is
554
+ destroyed.
555
+
556
+ This parameter defaults to 0.
557
+
558
+ =item C<< MultiStream => 0|1 >>
559
+
560
+ Allows multiple concatenated compressed streams to be treated as a single
561
+ compressed stream. Decompression will stop once either the end of the
562
+ file/buffer is reached, an error is encountered (premature eof, corrupt
563
+ compressed data) or the end of a stream is not immediately followed by the
564
+ start of another stream.
565
+
566
+ This parameter defaults to 0.
567
+
568
+ =item C<< Prime => $string >>
569
+
570
+ This option will uncompress the contents of C<$string> before processing the
571
+ input file/buffer.
572
+
573
+ This option can be useful when the compressed data is embedded in another
574
+ file/data structure and it is not possible to work out where the compressed
575
+ data begins without having to read the first few bytes. If this is the
576
+ case, the uncompression can be I<primed> with these bytes using this
577
+ option.
578
+
579
+ =item C<< Transparent => 0|1 >>
580
+
581
+ If this option is set and the input file/buffer is not compressed data,
582
+ the module will allow reading of it anyway.
583
+
584
+ In addition, if the input file/buffer does contain compressed data and
585
+ there is non-compressed data immediately following it, setting this option
586
+ will make this module treat the whole file/buffer as a single data stream.
587
+
588
+ This option defaults to 1.
589
+
590
+ =item C<< BlockSize => $num >>
591
+
592
+ When reading the compressed input data, IO::Uncompress::Bunzip2 will read it in
593
+ blocks of C<$num> bytes.
594
+
595
+ This option defaults to 4096.
596
+
597
+ =item C<< InputLength => $size >>
598
+
599
+ When present this option will limit the number of compressed bytes read
600
+ from the input file/buffer to C<$size>. This option can be used in the
601
+ situation where there is useful data directly after the compressed data
602
+ stream and you know beforehand the exact length of the compressed data
603
+ stream.
604
+
605
+ This option is mostly used when reading from a filehandle, in which case
606
+ the file pointer will be left pointing to the first byte directly after the
607
+ compressed data stream.
608
+
609
+ This option defaults to off.
610
+
611
+ =item C<< Append => 0|1 >>
612
+
613
+ This option controls what the C<read> method does with uncompressed data.
614
+
615
+ If set to 1, all uncompressed data will be appended to the output parameter
616
+ of the C<read> method.
617
+
618
+ If set to 0, the contents of the output parameter of the C<read> method
619
+ will be overwritten by the uncompressed data.
620
+
621
+ Defaults to 0.
622
+
623
+ =item C<< Strict => 0|1 >>
624
+
625
+ This option is a no-op.
626
+
627
+ =item C<< Small => 0|1 >>
628
+
629
+ When non-zero this options will make bzip2 use a decompression algorithm
630
+ that uses less memory at the expense of increasing the amount of time
631
+ taken for decompression.
632
+
633
+ Default is 0.
634
+
635
+ =back
636
+
637
+ =head1 Methods
638
+
639
+ =head2 read
640
+
641
+ Usage is
642
+
643
+ $status = $z->read($buffer)
644
+
645
+ Reads a block of compressed data (the size of the compressed block is
646
+ determined by the C<Buffer> option in the constructor), uncompresses it and
647
+ writes any uncompressed data into C<$buffer>. If the C<Append> parameter is
648
+ set in the constructor, the uncompressed data will be appended to the
649
+ C<$buffer> parameter. Otherwise C<$buffer> will be overwritten.
650
+
651
+ Returns the number of uncompressed bytes written to C<$buffer>, zero if eof
652
+ or a negative number on error.
653
+
654
+ =head2 read
655
+
656
+ Usage is
657
+
658
+ $status = $z->read($buffer, $length)
659
+ $status = $z->read($buffer, $length, $offset)
660
+
661
+ $status = read($z, $buffer, $length)
662
+ $status = read($z, $buffer, $length, $offset)
663
+
664
+ Attempt to read C<$length> bytes of uncompressed data into C<$buffer>.
665
+
666
+ The main difference between this form of the C<read> method and the
667
+ previous one, is that this one will attempt to return I<exactly> C<$length>
668
+ bytes. The only circumstances that this function will not is if end-of-file
669
+ or an IO error is encountered.
670
+
671
+ Returns the number of uncompressed bytes written to C<$buffer>, zero if eof
672
+ or a negative number on error.
673
+
674
+ =head2 getline
675
+
676
+ Usage is
677
+
678
+ $line = $z->getline()
679
+ $line = <$z>
680
+
681
+ Reads a single line.
682
+
683
+ This method fully supports the use of the variable C<$/> (or
684
+ C<$INPUT_RECORD_SEPARATOR> or C<$RS> when C<English> is in use) to
685
+ determine what constitutes an end of line. Paragraph mode, record mode and
686
+ file slurp mode are all supported.
687
+
688
+ =head2 getc
689
+
690
+ Usage is
691
+
692
+ $char = $z->getc()
693
+
694
+ Read a single character.
695
+
696
+ =head2 ungetc
697
+
698
+ Usage is
699
+
700
+ $char = $z->ungetc($string)
701
+
702
+ =head2 getHeaderInfo
703
+
704
+ Usage is
705
+
706
+ $hdr = $z->getHeaderInfo();
707
+ @hdrs = $z->getHeaderInfo();
708
+
709
+ This method returns either a hash reference (in scalar context) or a list
710
+ or hash references (in array context) that contains information about each
711
+ of the header fields in the compressed data stream(s).
712
+
713
+ =head2 tell
714
+
715
+ Usage is
716
+
717
+ $z->tell()
718
+ tell $z
719
+
720
+ Returns the uncompressed file offset.
721
+
722
+ =head2 eof
723
+
724
+ Usage is
725
+
726
+ $z->eof();
727
+ eof($z);
728
+
729
+ Returns true if the end of the compressed input stream has been reached.
730
+
731
+ =head2 seek
732
+
733
+ $z->seek($position, $whence);
734
+ seek($z, $position, $whence);
735
+
736
+ Provides a sub-set of the C<seek> functionality, with the restriction
737
+ that it is only legal to seek forward in the input file/buffer.
738
+ It is a fatal error to attempt to seek backward.
739
+
740
+ Note that the implementation of C<seek> in this module does not provide
741
+ true random access to a compressed file/buffer. It works by uncompressing
742
+ data from the current offset in the file/buffer until it reaches the
743
+ uncompressed offset specified in the parameters to C<seek>. For very small
744
+ files this may be acceptable behaviour. For large files it may cause an
745
+ unacceptable delay.
746
+
747
+ The C<$whence> parameter takes one the usual values, namely SEEK_SET,
748
+ SEEK_CUR or SEEK_END.
749
+
750
+ Returns 1 on success, 0 on failure.
751
+
752
+ =head2 binmode
753
+
754
+ Usage is
755
+
756
+ $z->binmode
757
+ binmode $z ;
758
+
759
+ This is a noop provided for completeness.
760
+
761
+ =head2 opened
762
+
763
+ $z->opened()
764
+
765
+ Returns true if the object currently refers to a opened file/buffer.
766
+
767
+ =head2 autoflush
768
+
769
+ my $prev = $z->autoflush()
770
+ my $prev = $z->autoflush(EXPR)
771
+
772
+ If the C<$z> object is associated with a file or a filehandle, this method
773
+ returns the current autoflush setting for the underlying filehandle. If
774
+ C<EXPR> is present, and is non-zero, it will enable flushing after every
775
+ write/print operation.
776
+
777
+ If C<$z> is associated with a buffer, this method has no effect and always
778
+ returns C<undef>.
779
+
780
+ B<Note> that the special variable C<$|> B<cannot> be used to set or
781
+ retrieve the autoflush setting.
782
+
783
+ =head2 input_line_number
784
+
785
+ $z->input_line_number()
786
+ $z->input_line_number(EXPR)
787
+
788
+ Returns the current uncompressed line number. If C<EXPR> is present it has
789
+ the effect of setting the line number. Note that setting the line number
790
+ does not change the current position within the file/buffer being read.
791
+
792
+ The contents of C<$/> are used to determine what constitutes a line
793
+ terminator.
794
+
795
+ =head2 fileno
796
+
797
+ $z->fileno()
798
+ fileno($z)
799
+
800
+ If the C<$z> object is associated with a file or a filehandle, C<fileno>
801
+ will return the underlying file descriptor. Once the C<close> method is
802
+ called C<fileno> will return C<undef>.
803
+
804
+ If the C<$z> object is associated with a buffer, this method will return
805
+ C<undef>.
806
+
807
+ =head2 close
808
+
809
+ $z->close() ;
810
+ close $z ;
811
+
812
+ Closes the output file/buffer.
813
+
814
+ For most versions of Perl this method will be automatically invoked if
815
+ the IO::Uncompress::Bunzip2 object is destroyed (either explicitly or by the
816
+ variable with the reference to the object going out of scope). The
817
+ exceptions are Perl versions 5.005 through 5.00504 and 5.8.0. In
818
+ these cases, the C<close> method will be called automatically, but
819
+ not until global destruction of all live objects when the program is
820
+ terminating.
821
+
822
+ Therefore, if you want your scripts to be able to run on all versions
823
+ of Perl, you should call C<close> explicitly and not rely on automatic
824
+ closing.
825
+
826
+ Returns true on success, otherwise 0.
827
+
828
+ If the C<AutoClose> option has been enabled when the IO::Uncompress::Bunzip2
829
+ object was created, and the object is associated with a file, the
830
+ underlying file will also be closed.
831
+
832
+ =head2 nextStream
833
+
834
+ Usage is
835
+
836
+ my $status = $z->nextStream();
837
+
838
+ Skips to the next compressed data stream in the input file/buffer. If a new
839
+ compressed data stream is found, the eof marker will be cleared and C<$.>
840
+ will be reset to 0.
841
+
842
+ Returns 1 if a new stream was found, 0 if none was found, and -1 if an
843
+ error was encountered.
844
+
845
+ =head2 trailingData
846
+
847
+ Usage is
848
+
849
+ my $data = $z->trailingData();
850
+
851
+ Returns the data, if any, that is present immediately after the compressed
852
+ data stream once uncompression is complete. It only makes sense to call
853
+ this method once the end of the compressed data stream has been
854
+ encountered.
855
+
856
+ This option can be used when there is useful information immediately
857
+ following the compressed data stream, and you don't know the length of the
858
+ compressed data stream.
859
+
860
+ If the input is a buffer, C<trailingData> will return everything from the
861
+ end of the compressed data stream to the end of the buffer.
862
+
863
+ If the input is a filehandle, C<trailingData> will return the data that is
864
+ left in the filehandle input buffer once the end of the compressed data
865
+ stream has been reached. You can then use the filehandle to read the rest
866
+ of the input file.
867
+
868
+ Don't bother using C<trailingData> if the input is a filename.
869
+
870
+ If you know the length of the compressed data stream before you start
871
+ uncompressing, you can avoid having to use C<trailingData> by setting the
872
+ C<InputLength> option in the constructor.
873
+
874
+ =head1 Importing
875
+
876
+ No symbolic constants are required by IO::Uncompress::Bunzip2 at present.
877
+
878
+ =over 5
879
+
880
+ =item :all
881
+
882
+ Imports C<bunzip2> and C<$Bunzip2Error>.
883
+ Same as doing this
884
+
885
+ use IO::Uncompress::Bunzip2 qw(bunzip2 $Bunzip2Error) ;
886
+
887
+ =back
888
+
889
+ =head1 EXAMPLES
890
+
891
+ =head2 Working with Net::FTP
892
+
893
+ See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
894
+
895
+ =head1 SUPPORT
896
+
897
+ General feedback/questions/bug reports should be sent to
898
+ L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
899
+ L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
900
+
901
+ =head1 SEE ALSO
902
+
903
+ L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Compress::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
904
+
905
+ L<IO::Compress::FAQ|IO::Compress::FAQ>
906
+
907
+ L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
908
+ L<Archive::Tar|Archive::Tar>,
909
+ L<IO::Zlib|IO::Zlib>
910
+
911
+ The primary site for the bzip2 program is L<https://sourceware.org/bzip2/>.
912
+
913
+ See the module L<Compress::Bzip2|Compress::Bzip2>
914
+
915
+ =head1 AUTHOR
916
+
917
+ This module was written by Paul Marquess, C<pmqs@cpan.org>.
918
+
919
+ =head1 MODIFICATION HISTORY
920
+
921
+ See the Changes file.
922
+
923
+ =head1 COPYRIGHT AND LICENSE
924
+
925
+ Copyright (c) 2005-2024 Paul Marquess. All rights reserved.
926
+
927
+ This program is free software; you can redistribute it and/or
928
+ modify it under the same terms as Perl itself.
micromamba_root/DLLs/_ctypes.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:564f71f3872dc329955f64a61fddf290299e450550cfedfe425f7d5d89f6b9da
3
+ size 136192
micromamba_root/DLLs/_ctypes_test.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2c97ef40b232562f939e5a492190de90654b440235f358b5cb09d32934b7e46
3
+ size 119296
micromamba_root/DLLs/_decimal.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a925dc8d0549f3a9424859b85192946167ec12cfb4299a03b1e2861e25c7c5d5
3
+ size 164864
micromamba_root/DLLs/_sqlite3.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33f1e15fb0fcc58bb7251c851b3eb7209b12ffb78772b2013cf09b25c28549f7
3
+ size 109568
micromamba_root/DLLs/_ssl.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b3b041f3c10339dd2d8314f9ff9ddcaf1afd557e3a711df0b8af27c2c08abd2
3
+ size 181248
micromamba_root/DLLs/_testcapi.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:258a8bc7f42f63ac90d64bd039af2143a8716c617a0bb5b262ed4c080d718ee3
3
+ size 290816
micromamba_root/DLLs/_testlimitedcapi.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c6aad61e2c1b78a98d70fbffa52e0fe26bf09869dd71d27786ff2f64cd09641
3
+ size 140800
micromamba_root/DLLs/unicodedata.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2780d73dc9be963fb924f62eb227622e7fe768e86f19cac407e354f0b70b2683
3
+ size 744448
micromamba_root/Scripts/cppcheck-htmlreport.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:911a4f9426a062bb84df44130cebfd74d9c6913a7320c0c04975a77d8c765aca
3
+ size 108366
micromamba_root/Scripts/ruff.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16cb1537b9b28ae83c15dd92488f026dfe41be164cc2bcde2a32286ab17479eb
3
+ size 32527360
micromamba_root/libs/python3.lib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dfb38e8bc5986bbd277b421544c4ae4ae3430fdd3ada15f9bde27540ecfe0cb
3
+ size 198184
micromamba_root/libs/python314.lib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3e1766f345719f4fc11e3d49f87d42f767e4d7c00928370b6d300fe75bcb0d4
3
+ size 404054
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1.conda ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a14a9ad02101aab25570543a59c5193043b73dc311a25650134ed9e6cb691770
3
+ size 7684321
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/global.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a389dc74e1eba5b601c3c7b417c8d07b9e41f199370d10cc2cc70c771771156e
3
+ size 461219
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/af.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4ef7fdc1a49490009de067f8fa65d5291aadf3a84bfa088659f82a494d7c2be
3
+ size 144732
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ak.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fbdf2ff2961672dfd4a511a0300388c2a8fffddaa2ef225b1a825fa8d9194a1
3
+ size 116224
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/am.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4dd75f79121216fce34c5a41faf1f782348ab36afc893dc261c92bae289b5d96
3
+ size 173260
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ar.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c808a396491a1fe46045089dbc2c8d064a62f59ece4c2f5c35f21b2a8e27e209
3
+ size 288582
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/as.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c684e68627a80158f0e7d876fbfa4ba74c237d93d5bd8315eaa0d22632eb8eaf
3
+ size 209876
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ast.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd07a8734833d5a83d32498d22ebf8b9f5639347c7e71b56e0ceefa7c493e216
3
+ size 168961
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/az.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8473031cf2a22a096fc5d087365e3150b619021b27cb37327325953df5971a0
3
+ size 173802
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bal_Latn.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fdb04bc2ed25345541676a9cc5294ab49ef7356b3d5cf651e6ac23c73c28385
3
+ size 116909
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/be.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f0be90d02e308db2cc0bd23b96d168635a6b013b9177ef279f4b9da6b60123a0
3
+ size 272322
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/be_TARASK.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f77c43c4ed3a9ee02e8295a3ae7c7a0b993c16cdba1c80289547143eea0785b8
3
+ size 104118
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bew.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99f291db73d23f24b4007c5b692b8cbee7d965094c202c431ae3efefc32d0db5
3
+ size 122095
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bg.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1f77f4efe289c83f5704d6954efb5ef5c9247d2495ee1cace95aa73ebed2cff
3
+ size 227940
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/blo.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23481fb06bfcd317fb768fa8c738e4876a2bf77e18c5880332433d4477fb5179
3
+ size 168499
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bn.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d34711298af0ca4e6c9e1ade90b8f44d0055cd9955fcf8d0d1a2e5b00a60c31c
3
+ size 219185
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/br.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ac1b35069f47e90e0408eda6a2ea099a7096d2ec7908b3f1d73cb7d86be9902a
3
+ size 272612
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/brx.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0bf2b7d0c23c2d8f7cb9339cf3744075d306b2e08f4fda6f00d84d264c871a7
3
+ size 160164
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bs.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6152db5c62c77fa419f6f6270a3c633b7b81226b989e8c51f9c12e04f55b3ffc
3
+ size 213968
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/bs_Cyrl.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2a17010515f62acb3915becc23f0247607f4426f9d4ccaff2341a0c38f3d2ef
3
+ size 219235
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ca.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0884f4fbb5fbfdef1129646b84b4a61be6810b60f9d7e86f46b4d5fbb8816aff
3
+ size 184038
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ccp.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:267fcee4cc0de83306c4dad752976b853ff3e59398877f929b9c8651c57c6c82
3
+ size 207292
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ce.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:caea295b9402ab5bbc13546cd2110ebffcb5baf6de9bf3f794afbf02f539ccb1
3
+ size 135403
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/ceb.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f08093c057a4dfbf26af6545bef6929e2d469c32e1f4de10a44a41dd2069bc2
3
+ size 100779
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/chr.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1ae9e2635f5259fa29c293e27c80726ad50b682b716939784e9503036c78f03
3
+ size 187187
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cs.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3baa786e22ac693c87c3fa8c952ecbe99a1b518883b380906831a66fcaf3cbe
3
+ size 247800
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cv.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:054a92fb846f02ec9c3a5026fe4df7795f7c542a796c8526ad652a8e19acaa5b
3
+ size 198348
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/cy.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9b374d16a9185d9c22fd55d9c682d52dc1b999ee7dabf7aa1974bbb148ff0a3
3
+ size 276313
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/da.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:030db49c3701be7596a72d8862f83d4bc8495684fe81abc9fcba249b0a692cbe
3
+ size 171762
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/de.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97a001560db35cf5fd5acf60dbe59ebded394b8ea28b48676ee095892ea6b660
3
+ size 178630
micromamba_root/pkgs/https/conda.anaconda.org/conda-forge/noarch/babel-2.18.0-pyhcf101f3_1/site-packages/babel/locale-data/dsb.dat ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2af671ca6299e596f143ee204bfbaf9cd92b60c627dc3f812b3d0c1809f9e3cf
3
+ size 203926