| Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Archive/Zip.pm |
| Statements | Executed 541 statements in 3.46ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 4.37ms | 9.88ms | Archive::Zip::BEGIN@11 |
| 1 | 1 | 1 | 2.13ms | 2.30ms | Archive::Zip::BEGIN@6 |
| 1 | 1 | 1 | 2.04ms | 3.83ms | Archive::Zip::BEGIN@9 |
| 1 | 1 | 1 | 1.46ms | 1.64ms | Archive::Zip::BEGIN@10 |
| 1 | 1 | 1 | 410µs | 3.66ms | Archive::Zip::BEGIN@7 |
| 1 | 1 | 1 | 363µs | 458µs | Archive::Zip::BEGIN@12 |
| 19 | 3 | 2 | 72µs | 152µs | Archive::Zip::_readSignature |
| 8 | 2 | 2 | 41µs | 343µs | Archive::Zip::_newFileHandle |
| 8 | 1 | 1 | 29µs | 35µs | Archive::Zip::_CAN |
| 8 | 2 | 2 | 23µs | 80µs | Archive::Zip::_binmode |
| 1 | 1 | 1 | 16µs | 52µs | Archive::Zip::BEGIN@37 |
| 1 | 1 | 1 | 13µs | 27µs | Archive::Zip::BEGIN@289 |
| 1 | 1 | 1 | 10µs | 10µs | Archive::Zip::BEGIN@3 |
| 4 | 4 | 1 | 9µs | 12µs | Archive::Zip::_ISA |
| 1 | 1 | 1 | 8µs | 20µs | Archive::Zip::_isSeekable |
| 1 | 1 | 1 | 6µs | 6µs | Archive::Zip::BEGIN@16 |
| 1 | 1 | 1 | 6µs | 18µs | Archive::Zip::BEGIN@221 |
| 1 | 1 | 1 | 5µs | 18µs | Archive::Zip::BEGIN@236 |
| 1 | 1 | 1 | 4µs | 23µs | Archive::Zip::BEGIN@275 |
| 1 | 1 | 1 | 4µs | 27µs | Archive::Zip::BEGIN@185 |
| 1 | 1 | 1 | 4µs | 21µs | Archive::Zip::BEGIN@14 |
| 1 | 1 | 1 | 4µs | 5µs | Archive::Zip::BEGIN@4 |
| 1 | 1 | 1 | 4µs | 19µs | Archive::Zip::BEGIN@205 |
| 1 | 1 | 1 | 4µs | 16µs | Archive::Zip::new |
| 1 | 1 | 1 | 3µs | 19µs | Archive::Zip::BEGIN@188 |
| 1 | 1 | 1 | 3µs | 18µs | Archive::Zip::BEGIN@206 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@201 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@23 |
| 1 | 1 | 1 | 3µs | 17µs | Archive::Zip::BEGIN@269 |
| 1 | 1 | 1 | 3µs | 17µs | Archive::Zip::BEGIN@295 |
| 1 | 1 | 1 | 3µs | 18µs | Archive::Zip::BEGIN@302 |
| 1 | 1 | 1 | 3µs | 20µs | Archive::Zip::BEGIN@305 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@306 |
| 1 | 1 | 1 | 3µs | 17µs | Archive::Zip::BEGIN@199 |
| 1 | 1 | 1 | 3µs | 17µs | Archive::Zip::BEGIN@247 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@273 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@288 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@307 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@35 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@189 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@191 |
| 1 | 1 | 1 | 3µs | 14µs | Archive::Zip::BEGIN@192 |
| 1 | 1 | 1 | 3µs | 15µs | Archive::Zip::BEGIN@197 |
| 1 | 1 | 1 | 3µs | 15µs | Archive::Zip::BEGIN@200 |
| 1 | 1 | 1 | 3µs | 15µs | Archive::Zip::BEGIN@212 |
| 1 | 1 | 1 | 3µs | 17µs | Archive::Zip::BEGIN@230 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@238 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@251 |
| 1 | 1 | 1 | 3µs | 18µs | Archive::Zip::BEGIN@257 |
| 1 | 1 | 1 | 3µs | 20µs | Archive::Zip::BEGIN@260 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@268 |
| 1 | 1 | 1 | 3µs | 15µs | Archive::Zip::BEGIN@274 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@279 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@285 |
| 1 | 1 | 1 | 3µs | 15µs | Archive::Zip::BEGIN@291 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@300 |
| 1 | 1 | 1 | 3µs | 20µs | Archive::Zip::BEGIN@301 |
| 1 | 1 | 1 | 3µs | 16µs | Archive::Zip::BEGIN@308 |
| 1 | 1 | 1 | 3µs | 20µs | Archive::Zip::BEGIN@309 |
| 1 | 1 | 1 | 2µs | 16µs | Archive::Zip::BEGIN@190 |
| 1 | 1 | 1 | 2µs | 16µs | Archive::Zip::BEGIN@198 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@204 |
| 1 | 1 | 1 | 2µs | 16µs | Archive::Zip::BEGIN@222 |
| 1 | 1 | 1 | 2µs | 16µs | Archive::Zip::BEGIN@239 |
| 1 | 1 | 1 | 2µs | 17µs | Archive::Zip::BEGIN@256 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@265 |
| 1 | 1 | 1 | 2µs | 19µs | Archive::Zip::BEGIN@277 |
| 1 | 1 | 1 | 2µs | 17µs | Archive::Zip::BEGIN@283 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@292 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@294 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@298 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@312 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@203 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@207 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@208 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@210 |
| 1 | 1 | 1 | 2µs | 19µs | Archive::Zip::BEGIN@211 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@213 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@227 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@235 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@245 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@246 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@253 |
| 1 | 1 | 1 | 2µs | 16µs | Archive::Zip::BEGIN@261 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@266 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@272 |
| 1 | 1 | 1 | 2µs | 16µs | Archive::Zip::BEGIN@278 |
| 1 | 1 | 1 | 2µs | 16µs | Archive::Zip::BEGIN@282 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@297 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@310 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@313 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@202 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@209 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@214 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@215 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@220 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@228 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@229 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@237 |
| 1 | 1 | 1 | 2µs | 23µs | Archive::Zip::BEGIN@286 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@311 |
| 1 | 1 | 1 | 2µs | 2µs | Archive::Zip::BEGIN@8 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@252 |
| 1 | 1 | 1 | 2µs | 14µs | Archive::Zip::BEGIN@262 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@267 |
| 1 | 1 | 1 | 2µs | 15µs | Archive::Zip::BEGIN@240 |
| 1 | 1 | 1 | 2µs | 2µs | Archive::Zip::BEGIN@25 |
| 1 | 1 | 1 | 1µs | 1µs | Archive::Zip::BEGIN@5 |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_asLocalName |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_asZipDirName |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_error |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_formatError |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_ioError |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_print |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_printError |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_subclassResponsibility |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::_zip64NotSupported |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::chunkSize |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::computeCRC32 |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::setChunkSize |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::setErrorHandler |
| 0 | 0 | 0 | 0s | 0s | Archive::Zip::tempFile |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Archive::Zip; | ||||
| 2 | |||||
| 3 | 2 | 28µs | 1 | 10µs | # spent 10µs within Archive::Zip::BEGIN@3 which was called:
# once (10µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 3 # spent 10µs making 1 call to Archive::Zip::BEGIN@3 |
| 4 | 2 | 14µs | 2 | 7µs | # spent 5µs (4+1) within Archive::Zip::BEGIN@4 which was called:
# once (4µs+1µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 4 # spent 5µs making 1 call to Archive::Zip::BEGIN@4
# spent 1µs making 1 call to strict::import |
| 5 | 2 | 11µs | 1 | 1µs | # spent 1µs within Archive::Zip::BEGIN@5 which was called:
# once (1µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 5 # spent 1µs making 1 call to Archive::Zip::BEGIN@5 |
| 6 | 2 | 84µs | 1 | 2.30ms | # spent 2.30ms (2.13+168µs) within Archive::Zip::BEGIN@6 which was called:
# once (2.13ms+168µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 6 # spent 2.30ms making 1 call to Archive::Zip::BEGIN@6 |
| 7 | 2 | 88µs | 1 | 3.66ms | # spent 3.66ms (410µs+3.25) within Archive::Zip::BEGIN@7 which was called:
# once (410µs+3.25ms) by Spreadsheet::ParseXLSX::BEGIN@11 at line 7 # spent 3.66ms making 1 call to Archive::Zip::BEGIN@7 |
| 8 | 2 | 10µs | 1 | 2µs | # spent 2µs within Archive::Zip::BEGIN@8 which was called:
# once (2µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 8 # spent 2µs making 1 call to Archive::Zip::BEGIN@8 |
| 9 | 2 | 85µs | 1 | 3.83ms | # spent 3.83ms (2.04+1.80) within Archive::Zip::BEGIN@9 which was called:
# once (2.04ms+1.80ms) by Spreadsheet::ParseXLSX::BEGIN@11 at line 9 # spent 3.83ms making 1 call to Archive::Zip::BEGIN@9 |
| 10 | 2 | 98µs | 1 | 1.64ms | # spent 1.64ms (1.46+174µs) within Archive::Zip::BEGIN@10 which was called:
# once (1.46ms+174µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 10 # spent 1.64ms making 1 call to Archive::Zip::BEGIN@10 |
| 11 | 2 | 123µs | 1 | 9.88ms | # spent 9.88ms (4.37+5.51) within Archive::Zip::BEGIN@11 which was called:
# once (4.37ms+5.51ms) by Spreadsheet::ParseXLSX::BEGIN@11 at line 11 # spent 9.88ms making 1 call to Archive::Zip::BEGIN@11 |
| 12 | 2 | 79µs | 1 | 458µs | # spent 458µs (363+95) within Archive::Zip::BEGIN@12 which was called:
# once (363µs+95µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 12 # spent 458µs making 1 call to Archive::Zip::BEGIN@12 |
| 13 | |||||
| 14 | 2 | 28µs | 2 | 37µs | # spent 21µs (4+17) within Archive::Zip::BEGIN@14 which was called:
# once (4µs+17µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 14 # spent 21µs making 1 call to Archive::Zip::BEGIN@14
# spent 17µs making 1 call to vars::import |
| 15 | |||||
| 16 | # spent 6µs within Archive::Zip::BEGIN@16 which was called:
# once (6µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 21 | ||||
| 17 | 1 | 200ns | $VERSION = '1.68'; | ||
| 18 | |||||
| 19 | 1 | 400ns | require Exporter; | ||
| 20 | 1 | 6µs | @ISA = qw( Exporter ); | ||
| 21 | 1 | 13µs | 1 | 6µs | } # spent 6µs making 1 call to Archive::Zip::BEGIN@16 |
| 22 | |||||
| 23 | 2 | 22µs | 2 | 29µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@23 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 23 # spent 16µs making 1 call to Archive::Zip::BEGIN@23
# spent 13µs making 1 call to vars::import |
| 24 | |||||
| 25 | # spent 2µs within Archive::Zip::BEGIN@25 which was called:
# once (2µs+0s) by Spreadsheet::ParseXLSX::BEGIN@11 at line 32 | ||||
| 26 | # This is the size we'll try to read, write, and (de)compress. | ||||
| 27 | # You could set it to something different if you had lots of memory | ||||
| 28 | # and needed more speed. | ||||
| 29 | 1 | 200ns | $ChunkSize ||= 32768; | ||
| 30 | |||||
| 31 | 1 | 2µs | $ErrorHandler = \&Carp::carp; | ||
| 32 | 1 | 11µs | 1 | 2µs | } # spent 2µs making 1 call to Archive::Zip::BEGIN@25 |
| 33 | |||||
| 34 | # BEGIN block is necessary here so that other modules can use the constants. | ||||
| 35 | 2 | 150µs | 2 | 30µs | # spent 16µs (3+14) within Archive::Zip::BEGIN@35 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 35 # spent 16µs making 1 call to Archive::Zip::BEGIN@35
# spent 14µs making 1 call to vars::import |
| 36 | |||||
| 37 | # spent 52µs (16+36) within Archive::Zip::BEGIN@37 which was called:
# once (16µs+36µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 182 | ||||
| 38 | 1 | 700ns | @EXPORT_OK = ('computeCRC32'); | ||
| 39 | 1 | 10µs | %EXPORT_TAGS = ( | ||
| 40 | CONSTANTS => [ | ||||
| 41 | qw( | ||||
| 42 | ZIP64_SUPPORTED | ||||
| 43 | FA_MSDOS | ||||
| 44 | FA_UNIX | ||||
| 45 | GPBF_ENCRYPTED_MASK | ||||
| 46 | GPBF_DEFLATING_COMPRESSION_MASK | ||||
| 47 | GPBF_HAS_DATA_DESCRIPTOR_MASK | ||||
| 48 | COMPRESSION_STORED | ||||
| 49 | COMPRESSION_DEFLATED | ||||
| 50 | COMPRESSION_LEVEL_NONE | ||||
| 51 | COMPRESSION_LEVEL_DEFAULT | ||||
| 52 | COMPRESSION_LEVEL_FASTEST | ||||
| 53 | COMPRESSION_LEVEL_BEST_COMPRESSION | ||||
| 54 | IFA_TEXT_FILE_MASK | ||||
| 55 | IFA_TEXT_FILE | ||||
| 56 | IFA_BINARY_FILE | ||||
| 57 | ZIP64_AS_NEEDED | ||||
| 58 | ZIP64_EOCD | ||||
| 59 | ZIP64_HEADERS | ||||
| 60 | ) | ||||
| 61 | ], | ||||
| 62 | |||||
| 63 | MISC_CONSTANTS => [ | ||||
| 64 | qw( | ||||
| 65 | FA_AMIGA | ||||
| 66 | FA_VAX_VMS | ||||
| 67 | FA_VM_CMS | ||||
| 68 | FA_ATARI_ST | ||||
| 69 | FA_OS2_HPFS | ||||
| 70 | FA_MACINTOSH | ||||
| 71 | FA_Z_SYSTEM | ||||
| 72 | FA_CPM | ||||
| 73 | FA_TOPS20 | ||||
| 74 | FA_WINDOWS_NTFS | ||||
| 75 | FA_QDOS | ||||
| 76 | FA_ACORN | ||||
| 77 | FA_VFAT | ||||
| 78 | FA_MVS | ||||
| 79 | FA_BEOS | ||||
| 80 | FA_TANDEM | ||||
| 81 | FA_THEOS | ||||
| 82 | GPBF_IMPLODING_8K_SLIDING_DICTIONARY_MASK | ||||
| 83 | GPBF_IMPLODING_3_SHANNON_FANO_TREES_MASK | ||||
| 84 | GPBF_IS_COMPRESSED_PATCHED_DATA_MASK | ||||
| 85 | COMPRESSION_SHRUNK | ||||
| 86 | DEFLATING_COMPRESSION_NORMAL | ||||
| 87 | DEFLATING_COMPRESSION_MAXIMUM | ||||
| 88 | DEFLATING_COMPRESSION_FAST | ||||
| 89 | DEFLATING_COMPRESSION_SUPER_FAST | ||||
| 90 | COMPRESSION_REDUCED_1 | ||||
| 91 | COMPRESSION_REDUCED_2 | ||||
| 92 | COMPRESSION_REDUCED_3 | ||||
| 93 | COMPRESSION_REDUCED_4 | ||||
| 94 | COMPRESSION_IMPLODED | ||||
| 95 | COMPRESSION_TOKENIZED | ||||
| 96 | COMPRESSION_DEFLATED_ENHANCED | ||||
| 97 | COMPRESSION_PKWARE_DATA_COMPRESSION_LIBRARY_IMPLODED | ||||
| 98 | ) | ||||
| 99 | ], | ||||
| 100 | |||||
| 101 | ERROR_CODES => [ | ||||
| 102 | qw( | ||||
| 103 | AZ_OK | ||||
| 104 | AZ_STREAM_END | ||||
| 105 | AZ_ERROR | ||||
| 106 | AZ_FORMAT_ERROR | ||||
| 107 | AZ_IO_ERROR | ||||
| 108 | ) | ||||
| 109 | ], | ||||
| 110 | |||||
| 111 | # For Internal Use Only | ||||
| 112 | PKZIP_CONSTANTS => [ | ||||
| 113 | qw( | ||||
| 114 | SIGNATURE_FORMAT | ||||
| 115 | SIGNATURE_LENGTH | ||||
| 116 | |||||
| 117 | LOCAL_FILE_HEADER_SIGNATURE | ||||
| 118 | LOCAL_FILE_HEADER_FORMAT | ||||
| 119 | LOCAL_FILE_HEADER_LENGTH | ||||
| 120 | |||||
| 121 | DATA_DESCRIPTOR_SIGNATURE | ||||
| 122 | DATA_DESCRIPTOR_FORMAT | ||||
| 123 | DATA_DESCRIPTOR_LENGTH | ||||
| 124 | DATA_DESCRIPTOR_ZIP64_FORMAT | ||||
| 125 | DATA_DESCRIPTOR_ZIP64_LENGTH | ||||
| 126 | |||||
| 127 | DATA_DESCRIPTOR_FORMAT_NO_SIG | ||||
| 128 | DATA_DESCRIPTOR_LENGTH_NO_SIG | ||||
| 129 | DATA_DESCRIPTOR_ZIP64_FORMAT_NO_SIG | ||||
| 130 | DATA_DESCRIPTOR_ZIP64_LENGTH_NO_SIG | ||||
| 131 | |||||
| 132 | CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE | ||||
| 133 | CENTRAL_DIRECTORY_FILE_HEADER_FORMAT | ||||
| 134 | CENTRAL_DIRECTORY_FILE_HEADER_LENGTH | ||||
| 135 | |||||
| 136 | ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE | ||||
| 137 | ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_FORMAT | ||||
| 138 | ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_LENGTH | ||||
| 139 | |||||
| 140 | ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE | ||||
| 141 | ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_FORMAT | ||||
| 142 | ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_LENGTH | ||||
| 143 | |||||
| 144 | END_OF_CENTRAL_DIRECTORY_SIGNATURE | ||||
| 145 | END_OF_CENTRAL_DIRECTORY_FORMAT | ||||
| 146 | END_OF_CENTRAL_DIRECTORY_LENGTH | ||||
| 147 | |||||
| 148 | ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE_STRING | ||||
| 149 | ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE_STRING | ||||
| 150 | END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING | ||||
| 151 | ) | ||||
| 152 | ], | ||||
| 153 | |||||
| 154 | # For Internal Use Only | ||||
| 155 | UTILITY_METHODS => [ | ||||
| 156 | qw( | ||||
| 157 | _error | ||||
| 158 | _printError | ||||
| 159 | _ioError | ||||
| 160 | _formatError | ||||
| 161 | _zip64NotSupported | ||||
| 162 | _subclassResponsibility | ||||
| 163 | _binmode | ||||
| 164 | _isSeekable | ||||
| 165 | _newFileHandle | ||||
| 166 | _readSignature | ||||
| 167 | _asZipDirName | ||||
| 168 | ) | ||||
| 169 | ], | ||||
| 170 | ); | ||||
| 171 | |||||
| 172 | # Add all the constant names and error code names to @EXPORT_OK | ||||
| 173 | 1 | 2µs | 1 | 12µs | Exporter::export_ok_tags( # spent 12µs making 1 call to Exporter::export_ok_tags |
| 174 | qw( | ||||
| 175 | CONSTANTS | ||||
| 176 | ERROR_CODES | ||||
| 177 | PKZIP_CONSTANTS | ||||
| 178 | UTILITY_METHODS | ||||
| 179 | MISC_CONSTANTS | ||||
| 180 | )); | ||||
| 181 | |||||
| 182 | 1 | 34µs | 1 | 52µs | } # spent 52µs making 1 call to Archive::Zip::BEGIN@37 |
| 183 | |||||
| 184 | # Zip64 format support status | ||||
| 185 | 3 | 29µs | 3 | 53µs | # spent 27µs (4+23) within Archive::Zip::BEGIN@185 which was called:
# once (4µs+23µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 185 # spent 27µs making 1 call to Archive::Zip::BEGIN@185
# spent 23µs making 1 call to constant::import
# spent 3µs making 1 call to CORE::pack |
| 186 | |||||
| 187 | # Error codes | ||||
| 188 | 2 | 13µs | 2 | 34µs | # spent 19µs (3+16) within Archive::Zip::BEGIN@188 which was called:
# once (3µs+16µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 188 # spent 19µs making 1 call to Archive::Zip::BEGIN@188
# spent 16µs making 1 call to constant::import |
| 189 | 2 | 13µs | 2 | 30µs | # spent 16µs (3+14) within Archive::Zip::BEGIN@189 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 189 # spent 16µs making 1 call to Archive::Zip::BEGIN@189
# spent 14µs making 1 call to constant::import |
| 190 | 2 | 11µs | 2 | 29µs | # spent 16µs (2+13) within Archive::Zip::BEGIN@190 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 190 # spent 16µs making 1 call to Archive::Zip::BEGIN@190
# spent 13µs making 1 call to constant::import |
| 191 | 2 | 11µs | 2 | 30µs | # spent 16µs (3+14) within Archive::Zip::BEGIN@191 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 191 # spent 16µs making 1 call to Archive::Zip::BEGIN@191
# spent 14µs making 1 call to constant::import |
| 192 | 2 | 12µs | 2 | 26µs | # spent 14µs (3+12) within Archive::Zip::BEGIN@192 which was called:
# once (3µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 192 # spent 14µs making 1 call to Archive::Zip::BEGIN@192
# spent 12µs making 1 call to constant::import |
| 193 | |||||
| 194 | # File types | ||||
| 195 | # Values of Archive::Zip::Member->fileAttributeFormat() | ||||
| 196 | |||||
| 197 | 2 | 11µs | 2 | 28µs | # spent 15µs (3+13) within Archive::Zip::BEGIN@197 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 197 # spent 15µs making 1 call to Archive::Zip::BEGIN@197
# spent 13µs making 1 call to constant::import |
| 198 | 2 | 17µs | 2 | 29µs | # spent 16µs (2+13) within Archive::Zip::BEGIN@198 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 198 # spent 16µs making 1 call to Archive::Zip::BEGIN@198
# spent 13µs making 1 call to constant::import |
| 199 | 2 | 12µs | 2 | 31µs | # spent 17µs (3+14) within Archive::Zip::BEGIN@199 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 199 # spent 17µs making 1 call to Archive::Zip::BEGIN@199
# spent 14µs making 1 call to constant::import |
| 200 | 2 | 11µs | 2 | 27µs | # spent 15µs (3+12) within Archive::Zip::BEGIN@200 which was called:
# once (3µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 200 # spent 15µs making 1 call to Archive::Zip::BEGIN@200
# spent 12µs making 1 call to constant::import |
| 201 | 2 | 11µs | 2 | 28µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@201 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 201 # spent 16µs making 1 call to Archive::Zip::BEGIN@201
# spent 13µs making 1 call to constant::import |
| 202 | 2 | 11µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@202 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 202 # spent 15µs making 1 call to Archive::Zip::BEGIN@202
# spent 12µs making 1 call to constant::import |
| 203 | 2 | 11µs | 2 | 26µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@203 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 203 # spent 14µs making 1 call to Archive::Zip::BEGIN@203
# spent 12µs making 1 call to constant::import |
| 204 | 2 | 17µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@204 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 204 # spent 15µs making 1 call to Archive::Zip::BEGIN@204
# spent 12µs making 1 call to constant::import |
| 205 | 2 | 46µs | 2 | 35µs | # spent 19µs (4+16) within Archive::Zip::BEGIN@205 which was called:
# once (4µs+16µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 205 # spent 19µs making 1 call to Archive::Zip::BEGIN@205
# spent 16µs making 1 call to constant::import |
| 206 | 2 | 12µs | 2 | 33µs | # spent 18µs (3+15) within Archive::Zip::BEGIN@206 which was called:
# once (3µs+15µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 206 # spent 18µs making 1 call to Archive::Zip::BEGIN@206
# spent 15µs making 1 call to constant::import |
| 207 | 2 | 11µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@207 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 207 # spent 15µs making 1 call to Archive::Zip::BEGIN@207
# spent 13µs making 1 call to constant::import |
| 208 | 2 | 11µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@208 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 208 # spent 15µs making 1 call to Archive::Zip::BEGIN@208
# spent 12µs making 1 call to constant::import |
| 209 | 2 | 11µs | 2 | 26µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@209 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 209 # spent 14µs making 1 call to Archive::Zip::BEGIN@209
# spent 12µs making 1 call to constant::import |
| 210 | 2 | 11µs | 2 | 26µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@210 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 210 # spent 14µs making 1 call to Archive::Zip::BEGIN@210
# spent 12µs making 1 call to constant::import |
| 211 | 2 | 12µs | 2 | 35µs | # spent 19µs (2+16) within Archive::Zip::BEGIN@211 which was called:
# once (2µs+16µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 211 # spent 19µs making 1 call to Archive::Zip::BEGIN@211
# spent 16µs making 1 call to constant::import |
| 212 | 2 | 15µs | 2 | 28µs | # spent 15µs (3+12) within Archive::Zip::BEGIN@212 which was called:
# once (3µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 212 # spent 15µs making 1 call to Archive::Zip::BEGIN@212
# spent 12µs making 1 call to constant::import |
| 213 | 2 | 11µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@213 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 213 # spent 15µs making 1 call to Archive::Zip::BEGIN@213
# spent 13µs making 1 call to constant::import |
| 214 | 2 | 11µs | 2 | 26µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@214 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 214 # spent 14µs making 1 call to Archive::Zip::BEGIN@214
# spent 12µs making 1 call to constant::import |
| 215 | 2 | 14µs | 2 | 26µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@215 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 215 # spent 14µs making 1 call to Archive::Zip::BEGIN@215
# spent 12µs making 1 call to constant::import |
| 216 | |||||
| 217 | # general-purpose bit flag masks | ||||
| 218 | # Found in Archive::Zip::Member->bitFlag() | ||||
| 219 | |||||
| 220 | 2 | 12µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@220 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 220 # spent 15µs making 1 call to Archive::Zip::BEGIN@220
# spent 13µs making 1 call to constant::import |
| 221 | 2 | 15µs | 2 | 31µs | # spent 18µs (6+13) within Archive::Zip::BEGIN@221 which was called:
# once (6µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 221 # spent 18µs making 1 call to Archive::Zip::BEGIN@221
# spent 13µs making 1 call to constant::import |
| 222 | 2 | 13µs | 2 | 29µs | # spent 16µs (2+13) within Archive::Zip::BEGIN@222 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 222 # spent 16µs making 1 call to Archive::Zip::BEGIN@222
# spent 13µs making 1 call to constant::import |
| 223 | |||||
| 224 | # deflating compression types, if compressionMethod == COMPRESSION_DEFLATED | ||||
| 225 | # ( Archive::Zip::Member->bitFlag() & GPBF_DEFLATING_COMPRESSION_MASK ) | ||||
| 226 | |||||
| 227 | 2 | 12µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@227 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 227 # spent 15µs making 1 call to Archive::Zip::BEGIN@227
# spent 13µs making 1 call to constant::import |
| 228 | 2 | 12µs | 2 | 27µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@228 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 228 # spent 15µs making 1 call to Archive::Zip::BEGIN@228
# spent 13µs making 1 call to constant::import |
| 229 | 2 | 14µs | 2 | 27µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@229 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 229 # spent 14µs making 1 call to Archive::Zip::BEGIN@229
# spent 12µs making 1 call to constant::import |
| 230 | 2 | 13µs | 2 | 31µs | # spent 17µs (3+14) within Archive::Zip::BEGIN@230 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 230 # spent 17µs making 1 call to Archive::Zip::BEGIN@230
# spent 14µs making 1 call to constant::import |
| 231 | |||||
| 232 | # compression method | ||||
| 233 | |||||
| 234 | # these two are the only ones supported in this module | ||||
| 235 | 2 | 15µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@235 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 235 # spent 15µs making 1 call to Archive::Zip::BEGIN@235
# spent 12µs making 1 call to constant::import |
| 236 | 2 | 12µs | 2 | 31µs | # spent 18µs (5+13) within Archive::Zip::BEGIN@236 which was called:
# once (5µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 236 # spent 18µs making 1 call to Archive::Zip::BEGIN@236
# spent 13µs making 1 call to constant::import |
| 237 | 2 | 16µs | 2 | 27µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@237 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 237 # spent 15µs making 1 call to Archive::Zip::BEGIN@237
# spent 13µs making 1 call to constant::import |
| 238 | 2 | 12µs | 2 | 30µs | # spent 16µs (3+14) within Archive::Zip::BEGIN@238 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 238 # spent 16µs making 1 call to Archive::Zip::BEGIN@238
# spent 14µs making 1 call to constant::import |
| 239 | 2 | 11µs | 2 | 30µs | # spent 16µs (2+14) within Archive::Zip::BEGIN@239 which was called:
# once (2µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 239 # spent 16µs making 1 call to Archive::Zip::BEGIN@239
# spent 14µs making 1 call to constant::import |
| 240 | 2 | 11µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@240 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 240 # spent 15µs making 1 call to Archive::Zip::BEGIN@240
# spent 13µs making 1 call to constant::import |
| 241 | |||||
| 242 | # internal file attribute bits | ||||
| 243 | # Found in Archive::Zip::Member::internalFileAttributes() | ||||
| 244 | |||||
| 245 | 2 | 15µs | 2 | 27µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@245 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 245 # spent 14µs making 1 call to Archive::Zip::BEGIN@245
# spent 12µs making 1 call to constant::import |
| 246 | 2 | 22µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@246 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 246 # spent 15µs making 1 call to Archive::Zip::BEGIN@246
# spent 13µs making 1 call to constant::import |
| 247 | 2 | 13µs | 2 | 32µs | # spent 17µs (3+15) within Archive::Zip::BEGIN@247 which was called:
# once (3µs+15µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 247 # spent 17µs making 1 call to Archive::Zip::BEGIN@247
# spent 15µs making 1 call to constant::import |
| 248 | |||||
| 249 | # desired zip64 structures for archive creation | ||||
| 250 | |||||
| 251 | 2 | 11µs | 2 | 28µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@251 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 251 # spent 16µs making 1 call to Archive::Zip::BEGIN@251
# spent 13µs making 1 call to constant::import |
| 252 | 2 | 10µs | 2 | 27µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@252 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 252 # spent 14µs making 1 call to Archive::Zip::BEGIN@252
# spent 12µs making 1 call to constant::import |
| 253 | 2 | 17µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@253 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 253 # spent 15µs making 1 call to Archive::Zip::BEGIN@253
# spent 12µs making 1 call to constant::import |
| 254 | |||||
| 255 | # PKZIP file format miscellaneous constants (for internal use only) | ||||
| 256 | 2 | 11µs | 2 | 31µs | # spent 17µs (2+14) within Archive::Zip::BEGIN@256 which was called:
# once (2µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 256 # spent 17µs making 1 call to Archive::Zip::BEGIN@256
# spent 14µs making 1 call to constant::import |
| 257 | 2 | 12µs | 2 | 34µs | # spent 18µs (3+16) within Archive::Zip::BEGIN@257 which was called:
# once (3µs+16µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 257 # spent 18µs making 1 call to Archive::Zip::BEGIN@257
# spent 16µs making 1 call to constant::import |
| 258 | |||||
| 259 | # these lengths are without the signature. | ||||
| 260 | 2 | 13µs | 2 | 38µs | # spent 20µs (3+18) within Archive::Zip::BEGIN@260 which was called:
# once (3µs+18µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 260 # spent 20µs making 1 call to Archive::Zip::BEGIN@260
# spent 18µs making 1 call to constant::import |
| 261 | 2 | 11µs | 2 | 29µs | # spent 16µs (2+13) within Archive::Zip::BEGIN@261 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 261 # spent 16µs making 1 call to Archive::Zip::BEGIN@261
# spent 13µs making 1 call to constant::import |
| 262 | 2 | 15µs | 2 | 27µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@262 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 262 # spent 14µs making 1 call to Archive::Zip::BEGIN@262
# spent 12µs making 1 call to constant::import |
| 263 | |||||
| 264 | # PKZIP docs don't mention the signature, but Info-Zip writes it. | ||||
| 265 | 2 | 11µs | 2 | 28µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@265 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 265 # spent 15µs making 1 call to Archive::Zip::BEGIN@265
# spent 12µs making 1 call to constant::import |
| 266 | 2 | 10µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@266 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 266 # spent 15µs making 1 call to Archive::Zip::BEGIN@266
# spent 12µs making 1 call to constant::import |
| 267 | 2 | 15µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@267 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 267 # spent 15µs making 1 call to Archive::Zip::BEGIN@267
# spent 13µs making 1 call to constant::import |
| 268 | 2 | 24µs | 2 | 29µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@268 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 268 # spent 16µs making 1 call to Archive::Zip::BEGIN@268
# spent 13µs making 1 call to constant::import |
| 269 | 2 | 13µs | 2 | 32µs | # spent 17µs (3+14) within Archive::Zip::BEGIN@269 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 269 # spent 17µs making 1 call to Archive::Zip::BEGIN@269
# spent 14µs making 1 call to constant::import |
| 270 | |||||
| 271 | # but the signature is apparently optional. | ||||
| 272 | 2 | 15µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@272 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 272 # spent 15µs making 1 call to Archive::Zip::BEGIN@272
# spent 12µs making 1 call to constant::import |
| 273 | 2 | 12µs | 2 | 29µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@273 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 273 # spent 16µs making 1 call to Archive::Zip::BEGIN@273
# spent 13µs making 1 call to constant::import |
| 274 | 2 | 11µs | 2 | 28µs | # spent 15µs (3+13) within Archive::Zip::BEGIN@274 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 274 # spent 15µs making 1 call to Archive::Zip::BEGIN@274
# spent 13µs making 1 call to constant::import |
| 275 | 2 | 13µs | 2 | 41µs | # spent 23µs (4+18) within Archive::Zip::BEGIN@275 which was called:
# once (4µs+18µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 275 # spent 23µs making 1 call to Archive::Zip::BEGIN@275
# spent 18µs making 1 call to constant::import |
| 276 | |||||
| 277 | 2 | 13µs | 2 | 36µs | # spent 19µs (2+17) within Archive::Zip::BEGIN@277 which was called:
# once (2µs+17µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 277 # spent 19µs making 1 call to Archive::Zip::BEGIN@277
# spent 17µs making 1 call to constant::import |
| 278 | 2 | 14µs | 2 | 29µs | # spent 16µs (2+13) within Archive::Zip::BEGIN@278 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 278 # spent 16µs making 1 call to Archive::Zip::BEGIN@278
# spent 13µs making 1 call to constant::import |
| 279 | 2 | 12µs | 2 | 29µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@279 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 279 # spent 16µs making 1 call to Archive::Zip::BEGIN@279
# spent 13µs making 1 call to constant::import |
| 280 | |||||
| 281 | # zip64 support | ||||
| 282 | 2 | 20µs | 2 | 29µs | # spent 16µs (2+13) within Archive::Zip::BEGIN@282 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 282 # spent 16µs making 1 call to Archive::Zip::BEGIN@282
# spent 13µs making 1 call to constant::import |
| 283 | 1 | 2µs | 1 | 15µs | # spent 17µs (2+15) within Archive::Zip::BEGIN@283 which was called:
# once (2µs+15µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 284 # spent 15µs making 1 call to constant::import |
| 284 | 1 | 11µs | 2 | 18µs | pack("V", ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE); # spent 17µs making 1 call to Archive::Zip::BEGIN@283
# spent 1µs making 1 call to CORE::pack |
| 285 | 2 | 11µs | 2 | 30µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@285 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 285 # spent 16µs making 1 call to Archive::Zip::BEGIN@285
# spent 14µs making 1 call to constant::import |
| 286 | 2 | 13µs | 2 | 43µs | # spent 23µs (2+20) within Archive::Zip::BEGIN@286 which was called:
# once (2µs+20µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 286 # spent 23µs making 1 call to Archive::Zip::BEGIN@286
# spent 20µs making 1 call to constant::import |
| 287 | |||||
| 288 | 2 | 29µs | 2 | 30µs | # spent 16µs (3+14) within Archive::Zip::BEGIN@288 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 288 # spent 16µs making 1 call to Archive::Zip::BEGIN@288
# spent 14µs making 1 call to constant::import |
| 289 | 1 | 2µs | 1 | 13µs | # spent 27µs (13+13) within Archive::Zip::BEGIN@289 which was called:
# once (13µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 290 # spent 13µs making 1 call to constant::import |
| 290 | 1 | 10µs | 2 | 27µs | pack("V", ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE); # spent 27µs making 1 call to Archive::Zip::BEGIN@289
# spent 700ns making 1 call to CORE::pack |
| 291 | 2 | 11µs | 2 | 28µs | # spent 15µs (3+13) within Archive::Zip::BEGIN@291 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 291 # spent 15µs making 1 call to Archive::Zip::BEGIN@291
# spent 13µs making 1 call to constant::import |
| 292 | 2 | 14µs | 2 | 26µs | # spent 14µs (2+12) within Archive::Zip::BEGIN@292 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 292 # spent 14µs making 1 call to Archive::Zip::BEGIN@292
# spent 12µs making 1 call to constant::import |
| 293 | |||||
| 294 | 2 | 21µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@294 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 294 # spent 15µs making 1 call to Archive::Zip::BEGIN@294
# spent 13µs making 1 call to constant::import |
| 295 | 1 | 2µs | 1 | 14µs | # spent 17µs (3+14) within Archive::Zip::BEGIN@295 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 296 # spent 14µs making 1 call to constant::import |
| 296 | 1 | 11µs | 2 | 17µs | pack("V", END_OF_CENTRAL_DIRECTORY_SIGNATURE); # spent 17µs making 1 call to Archive::Zip::BEGIN@295
# spent 600ns making 1 call to CORE::pack |
| 297 | 2 | 11µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@297 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 297 # spent 15µs making 1 call to Archive::Zip::BEGIN@297
# spent 13µs making 1 call to constant::import |
| 298 | 2 | 16µs | 2 | 28µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@298 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 298 # spent 15µs making 1 call to Archive::Zip::BEGIN@298
# spent 12µs making 1 call to constant::import |
| 299 | |||||
| 300 | 2 | 13µs | 2 | 30µs | # spent 16µs (3+14) within Archive::Zip::BEGIN@300 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 300 # spent 16µs making 1 call to Archive::Zip::BEGIN@300
# spent 14µs making 1 call to constant::import |
| 301 | 2 | 16µs | 2 | 37µs | # spent 20µs (3+17) within Archive::Zip::BEGIN@301 which was called:
# once (3µs+17µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 301 # spent 20µs making 1 call to Archive::Zip::BEGIN@301
# spent 17µs making 1 call to constant::import |
| 302 | 2 | 13µs | 2 | 34µs | # spent 18µs (3+15) within Archive::Zip::BEGIN@302 which was called:
# once (3µs+15µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 302 # spent 18µs making 1 call to Archive::Zip::BEGIN@302
# spent 15µs making 1 call to constant::import |
| 303 | |||||
| 304 | # the rest of these are not supported in this module | ||||
| 305 | 2 | 13µs | 2 | 37µs | # spent 20µs (3+17) within Archive::Zip::BEGIN@305 which was called:
# once (3µs+17µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 305 # spent 20µs making 1 call to Archive::Zip::BEGIN@305
# spent 17µs making 1 call to constant::import |
| 306 | 2 | 14µs | 2 | 30µs | # spent 16µs (3+14) within Archive::Zip::BEGIN@306 which was called:
# once (3µs+14µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 306 # spent 16µs making 1 call to Archive::Zip::BEGIN@306
# spent 14µs making 1 call to constant::import |
| 307 | 2 | 13µs | 2 | 29µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@307 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 307 # spent 16µs making 1 call to Archive::Zip::BEGIN@307
# spent 13µs making 1 call to constant::import |
| 308 | 2 | 25µs | 2 | 29µs | # spent 16µs (3+13) within Archive::Zip::BEGIN@308 which was called:
# once (3µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 308 # spent 16µs making 1 call to Archive::Zip::BEGIN@308
# spent 13µs making 1 call to constant::import |
| 309 | 2 | 12µs | 2 | 38µs | # spent 20µs (3+18) within Archive::Zip::BEGIN@309 which was called:
# once (3µs+18µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 309 # spent 20µs making 1 call to Archive::Zip::BEGIN@309
# spent 18µs making 1 call to constant::import |
| 310 | 2 | 11µs | 2 | 27µs | # spent 15µs (2+12) within Archive::Zip::BEGIN@310 which was called:
# once (2µs+12µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 310 # spent 15µs making 1 call to Archive::Zip::BEGIN@310
# spent 12µs making 1 call to constant::import |
| 311 | 2 | 16µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@311 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 311 # spent 15µs making 1 call to Archive::Zip::BEGIN@311
# spent 13µs making 1 call to constant::import |
| 312 | 2 | 11µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@312 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 312 # spent 15µs making 1 call to Archive::Zip::BEGIN@312
# spent 13µs making 1 call to constant::import |
| 313 | 2 | 795µs | 2 | 28µs | # spent 15µs (2+13) within Archive::Zip::BEGIN@313 which was called:
# once (2µs+13µs) by Spreadsheet::ParseXLSX::BEGIN@11 at line 313 # spent 15µs making 1 call to Archive::Zip::BEGIN@313
# spent 13µs making 1 call to constant::import |
| 314 | |||||
| 315 | # Load the various required classes | ||||
| 316 | 1 | 63µs | require Archive::Zip::Archive; | ||
| 317 | 1 | 54µs | require Archive::Zip::Member; | ||
| 318 | 1 | 57µs | require Archive::Zip::FileMember; | ||
| 319 | 1 | 50µs | require Archive::Zip::DirectoryMember; | ||
| 320 | 1 | 55µs | require Archive::Zip::ZipFileMember; | ||
| 321 | 1 | 53µs | require Archive::Zip::NewFileMember; | ||
| 322 | 1 | 59µs | require Archive::Zip::StringMember; | ||
| 323 | |||||
| 324 | # Convenience functions | ||||
| 325 | |||||
| 326 | # spent 12µs (9+3) within Archive::Zip::_ISA which was called 4 times, avg 3µs/call:
# once (5µs+2µs) by Archive::Zip::_isSeekable at line 441
# once (1µs+700ns) by Archive::Zip::_isSeekable at line 449
# once (1µs+600ns) by Archive::Zip::_isSeekable at line 443
# once (1µs+200ns) by Archive::Zip::_isSeekable at line 445 | ||||
| 327 | |||||
| 328 | # Can't rely on Scalar::Util, so use the next best way | ||||
| 329 | 4 | 300ns | local $@; | ||
| 330 | 8 | 14µs | 4 | 3µs | !!eval { ref $_[0] and $_[0]->isa($_[1]) }; # spent 3µs making 4 calls to UNIVERSAL::isa, avg 750ns/call |
| 331 | } | ||||
| 332 | |||||
| 333 | # spent 35µs (29+6) within Archive::Zip::_CAN which was called 8 times, avg 4µs/call:
# 8 times (29µs+6µs) by Archive::Zip::_binmode at line 432, avg 4µs/call | ||||
| 334 | 8 | 2µs | local $@; | ||
| 335 | 16 | 36µs | 8 | 6µs | !!eval { ref $_[0] and $_[0]->can($_[1]) }; # spent 6µs making 8 calls to UNIVERSAL::can, avg 775ns/call |
| 336 | } | ||||
| 337 | |||||
| 338 | ##################################################################### | ||||
| 339 | # Methods | ||||
| 340 | |||||
| 341 | # spent 16µs (4+12) within Archive::Zip::new which was called:
# once (4µs+12µs) by Spreadsheet::ParseXLSX::parse at line 75 of /home/micha/Projekt/spreadsheet-parsexlsx/lib/Spreadsheet/ParseXLSX.pm | ||||
| 342 | 1 | 300ns | my $class = shift; | ||
| 343 | 1 | 4µs | 1 | 12µs | return Archive::Zip::Archive->new(@_); # spent 12µs making 1 call to Archive::Zip::Archive::new |
| 344 | } | ||||
| 345 | |||||
| 346 | sub computeCRC32 { | ||||
| 347 | my ($data, $crc); | ||||
| 348 | |||||
| 349 | if (ref($_[0]) eq 'HASH') { | ||||
| 350 | $data = $_[0]->{string}; | ||||
| 351 | $crc = $_[0]->{checksum}; | ||||
| 352 | } else { | ||||
| 353 | $data = shift; | ||||
| 354 | $data = shift if ref($data); | ||||
| 355 | $crc = shift; | ||||
| 356 | } | ||||
| 357 | |||||
| 358 | return Compress::Raw::Zlib::crc32($data, $crc); | ||||
| 359 | } | ||||
| 360 | |||||
| 361 | # Report or change chunk size used for reading and writing. | ||||
| 362 | # Also sets Zlib's default buffer size (eventually). | ||||
| 363 | sub setChunkSize { | ||||
| 364 | shift if ref($_[0]) eq 'Archive::Zip::Archive'; | ||||
| 365 | my $chunkSize = (ref($_[0]) eq 'HASH') ? shift->{chunkSize} : shift; | ||||
| 366 | my $oldChunkSize = $Archive::Zip::ChunkSize; | ||||
| 367 | $Archive::Zip::ChunkSize = $chunkSize if ($chunkSize); | ||||
| 368 | return $oldChunkSize; | ||||
| 369 | } | ||||
| 370 | |||||
| 371 | sub chunkSize { | ||||
| 372 | return $Archive::Zip::ChunkSize; | ||||
| 373 | } | ||||
| 374 | |||||
| 375 | sub setErrorHandler { | ||||
| 376 | my $errorHandler = (ref($_[0]) eq 'HASH') ? shift->{subroutine} : shift; | ||||
| 377 | $errorHandler = \&Carp::carp unless defined($errorHandler); | ||||
| 378 | my $oldErrorHandler = $Archive::Zip::ErrorHandler; | ||||
| 379 | $Archive::Zip::ErrorHandler = $errorHandler; | ||||
| 380 | return $oldErrorHandler; | ||||
| 381 | } | ||||
| 382 | |||||
| 383 | ###################################################################### | ||||
| 384 | # Private utility functions (not methods). | ||||
| 385 | |||||
| 386 | sub _printError { | ||||
| 387 | my $string = join(' ', @_, "\n"); | ||||
| 388 | my $oldCarpLevel = $Carp::CarpLevel; | ||||
| 389 | $Carp::CarpLevel += 2; | ||||
| 390 | &{$ErrorHandler}($string); | ||||
| 391 | $Carp::CarpLevel = $oldCarpLevel; | ||||
| 392 | } | ||||
| 393 | |||||
| 394 | # This is called on format errors. | ||||
| 395 | sub _formatError { | ||||
| 396 | shift if ref($_[0]); | ||||
| 397 | _printError('format error:', @_); | ||||
| 398 | return AZ_FORMAT_ERROR; | ||||
| 399 | } | ||||
| 400 | |||||
| 401 | # This is called on IO errors. | ||||
| 402 | sub _ioError { | ||||
| 403 | shift if ref($_[0]); | ||||
| 404 | _printError('IO error:', @_, ':', $!); | ||||
| 405 | return AZ_IO_ERROR; | ||||
| 406 | } | ||||
| 407 | |||||
| 408 | # This is called on generic errors. | ||||
| 409 | sub _error { | ||||
| 410 | shift if ref($_[0]); | ||||
| 411 | _printError('error:', @_); | ||||
| 412 | return AZ_ERROR; | ||||
| 413 | } | ||||
| 414 | |||||
| 415 | # This is called if zip64 format is not supported but would be | ||||
| 416 | # required. | ||||
| 417 | sub _zip64NotSupported { | ||||
| 418 | shift if ref($_[0]); | ||||
| 419 | _printError('zip64 format not supported on this Perl interpreter'); | ||||
| 420 | return AZ_ERROR; | ||||
| 421 | } | ||||
| 422 | |||||
| 423 | # Called when a subclass should have implemented | ||||
| 424 | # something but didn't | ||||
| 425 | sub _subclassResponsibility { | ||||
| 426 | Carp::croak("subclass Responsibility\n"); | ||||
| 427 | } | ||||
| 428 | |||||
| 429 | # Try to set the given file handle or object into binary mode. | ||||
| 430 | # spent 80µs (23+57) within Archive::Zip::_binmode which was called 8 times, avg 10µs/call:
# 7 times (18µs+44µs) by Archive::Zip::FileMember::_openFile at line 44 of Archive/Zip/FileMember.pm, avg 9µs/call
# once (4µs+14µs) by Archive::Zip::Archive::readFromFileHandle at line 752 of Archive/Zip/Archive.pm | ||||
| 431 | 8 | 1µs | my $fh = shift; | ||
| 432 | 8 | 19µs | 16 | 57µs | return _CAN($fh, 'binmode') ? $fh->binmode() : binmode($fh); # spent 35µs making 8 calls to Archive::Zip::_CAN, avg 4µs/call
# spent 22µs making 8 calls to IO::Handle::binmode, avg 3µs/call |
| 433 | } | ||||
| 434 | |||||
| 435 | # Attempt to guess whether file handle is seekable. | ||||
| 436 | # Because of problems with Windows, this only returns true when | ||||
| 437 | # the file handle is a real file. | ||||
| 438 | # spent 20µs (8+12) within Archive::Zip::_isSeekable which was called:
# once (8µs+12µs) by Archive::Zip::Archive::readFromFileHandle at line 756 of Archive/Zip/Archive.pm | ||||
| 439 | 1 | 200ns | my $fh = shift; | ||
| 440 | 1 | 300ns | return 0 unless ref $fh; | ||
| 441 | 1 | 1µs | 1 | 7µs | _ISA($fh, "IO::Scalar") # IO::Scalar objects are brokenly-seekable # spent 7µs making 1 call to Archive::Zip::_ISA |
| 442 | and return 0; | ||||
| 443 | 1 | 1µs | 1 | 2µs | _ISA($fh, "IO::String") # spent 2µs making 1 call to Archive::Zip::_ISA |
| 444 | and return 1; | ||||
| 445 | 1 | 900ns | 1 | 2µs | if (_ISA($fh, "IO::Seekable")) { # spent 2µs making 1 call to Archive::Zip::_ISA |
| 446 | |||||
| 447 | # Unfortunately, some things like FileHandle objects | ||||
| 448 | # return true for Seekable, but AREN'T!!!!! | ||||
| 449 | 1 | 700ns | 1 | 2µs | _ISA($fh, "FileHandle") # spent 2µs making 1 call to Archive::Zip::_ISA |
| 450 | and return 0; | ||||
| 451 | 1 | 2µs | return 1; | ||
| 452 | } | ||||
| 453 | |||||
| 454 | # open my $fh, "+<", \$data; | ||||
| 455 | ref $fh eq "GLOB" && eval { seek $fh, 0, 1 } and return 1; | ||||
| 456 | _CAN($fh, "stat") | ||||
| 457 | and return -f $fh; | ||||
| 458 | return (_CAN($fh, "seek") and _CAN($fh, "tell")) ? 1 : 0; | ||||
| 459 | } | ||||
| 460 | |||||
| 461 | # Print to the filehandle, while making sure the pesky Perl special global | ||||
| 462 | # variables don't interfere. | ||||
| 463 | sub _print { | ||||
| 464 | my ($self, $fh, @data) = @_; | ||||
| 465 | |||||
| 466 | local $\; | ||||
| 467 | |||||
| 468 | return $fh->print(@data); | ||||
| 469 | } | ||||
| 470 | |||||
| 471 | # Return an opened IO::Handle | ||||
| 472 | # my ( $status, fh ) = _newFileHandle( 'fileName', 'w' ); | ||||
| 473 | # Can take a filename, file handle, or ref to GLOB | ||||
| 474 | # Or, if given something that is a ref but not an IO::Handle, | ||||
| 475 | # passes back the same thing. | ||||
| 476 | # spent 343µs (41+303) within Archive::Zip::_newFileHandle which was called 8 times, avg 43µs/call:
# 7 times (34µs+272µs) by Archive::Zip::FileMember::_openFile at line 38 of Archive/Zip/FileMember.pm, avg 44µs/call
# once (7µs+31µs) by Archive::Zip::Archive::read at line 726 of Archive/Zip/Archive.pm | ||||
| 477 | 8 | 1µs | my $fd = shift; | ||
| 478 | 8 | 1µs | my $status = 1; | ||
| 479 | 8 | 900ns | my $handle; | ||
| 480 | |||||
| 481 | 8 | 3µs | if (ref($fd)) { | ||
| 482 | if (_ISA($fd, 'IO::Scalar') or _ISA($fd, 'IO::String')) { | ||||
| 483 | $handle = $fd; | ||||
| 484 | } elsif (_ISA($fd, 'IO::Handle') or ref($fd) eq 'GLOB') { | ||||
| 485 | $handle = IO::File->new; | ||||
| 486 | $status = $handle->fdopen($fd, @_); | ||||
| 487 | } else { | ||||
| 488 | $handle = $fd; | ||||
| 489 | } | ||||
| 490 | } else { | ||||
| 491 | 8 | 13µs | 8 | 70µs | $handle = IO::File->new; # spent 70µs making 8 calls to IO::File::new, avg 9µs/call |
| 492 | 8 | 7µs | 8 | 232µs | $status = $handle->open($fd, @_); # spent 232µs making 8 calls to IO::File::open, avg 29µs/call |
| 493 | } | ||||
| 494 | |||||
| 495 | 8 | 10µs | return ($status, $handle); | ||
| 496 | } | ||||
| 497 | |||||
| 498 | # Returns next signature from given file handle, leaves | ||||
| 499 | # file handle positioned afterwards. | ||||
| 500 | # | ||||
| 501 | # In list context, returns ($status, $signature) | ||||
| 502 | # ( $status, $signature ) = _readSignature( $fh, $fileName ); | ||||
| 503 | # | ||||
| 504 | # This function returns one of AZ_OK, AZ_IO_ERROR, or | ||||
| 505 | # AZ_FORMAT_ERROR and calls the respective error handlers in the | ||||
| 506 | # latter two cases. If optional $noFormatError is true, it does | ||||
| 507 | # not call the error handler on format error, but only returns | ||||
| 508 | # AZ_FORMAT_ERROR. | ||||
| 509 | # spent 152µs (72+80) within Archive::Zip::_readSignature which was called 19 times, avg 8µs/call:
# 11 times (34µs+21µs) by Archive::Zip::Archive::readFromFileHandle at line 784 of Archive/Zip/Archive.pm, avg 5µs/call
# 7 times (29µs+54µs) by Archive::Zip::ZipFileMember::_seekToLocalHeader at line 70 of Archive/Zip/ZipFileMember.pm, avg 12µs/call
# once (8µs+4µs) by Archive::Zip::Archive::_readEndOfCentralDirectory at line 872 of Archive/Zip/Archive.pm | ||||
| 510 | 19 | 2µs | my $fh = shift; | ||
| 511 | 19 | 3µs | my $fileName = shift; | ||
| 512 | 19 | 2µs | my $expectedSignature = shift; # optional | ||
| 513 | 19 | 2µs | my $noFormatError = shift; # optional | ||
| 514 | |||||
| 515 | 19 | 2µs | my $signatureData; | ||
| 516 | 19 | 12µs | 19 | 70µs | my $bytesRead = $fh->read($signatureData, SIGNATURE_LENGTH); # spent 70µs making 19 calls to IO::Handle::read, avg 4µs/call |
| 517 | 19 | 3µs | if ($bytesRead != SIGNATURE_LENGTH) { | ||
| 518 | return _ioError("reading header signature"); | ||||
| 519 | } | ||||
| 520 | 19 | 27µs | 19 | 10µs | my $signature = unpack(SIGNATURE_FORMAT, $signatureData); # spent 10µs making 19 calls to CORE::unpack, avg 532ns/call |
| 521 | 19 | 2µs | my $status = AZ_OK; | ||
| 522 | |||||
| 523 | # compare with expected signature, if any, or any known signature. | ||||
| 524 | 19 | 7µs | if ( | ||
| 525 | (defined($expectedSignature) && $signature != $expectedSignature) | ||||
| 526 | || ( !defined($expectedSignature) | ||||
| 527 | && $signature != CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE | ||||
| 528 | && $signature != LOCAL_FILE_HEADER_SIGNATURE | ||||
| 529 | && $signature != END_OF_CENTRAL_DIRECTORY_SIGNATURE | ||||
| 530 | && $signature != DATA_DESCRIPTOR_SIGNATURE | ||||
| 531 | && $signature != ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIGNATURE | ||||
| 532 | && $signature != ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIGNATURE | ||||
| 533 | ) | ||||
| 534 | ) { | ||||
| 535 | 1 | 800ns | if (! $noFormatError ) { | ||
| 536 | my $errmsg = sprintf("bad signature: 0x%08x", $signature); | ||||
| 537 | if (_isSeekable($fh)) { | ||||
| 538 | $errmsg .= sprintf(" at offset %d", $fh->tell() - SIGNATURE_LENGTH); | ||||
| 539 | } | ||||
| 540 | |||||
| 541 | $status = _formatError("$errmsg in file $fileName"); | ||||
| 542 | } | ||||
| 543 | else { | ||||
| 544 | 1 | 200ns | $status = AZ_FORMAT_ERROR; | ||
| 545 | } | ||||
| 546 | } | ||||
| 547 | |||||
| 548 | 19 | 18µs | return ($status, $signature); | ||
| 549 | } | ||||
| 550 | |||||
| 551 | # Utility method to make and open a temp file. | ||||
| 552 | # Will create $temp_dir if it does not exist. | ||||
| 553 | # Returns file handle and name: | ||||
| 554 | # | ||||
| 555 | # my ($fh, $name) = Archive::Zip::tempFile(); | ||||
| 556 | # my ($fh, $name) = Archive::Zip::tempFile('mytempdir'); | ||||
| 557 | # | ||||
| 558 | |||||
| 559 | sub tempFile { | ||||
| 560 | my $dir = (ref($_[0]) eq 'HASH') ? shift->{tempDir} : shift; | ||||
| 561 | my ($fh, $filename) = File::Temp::tempfile( | ||||
| 562 | SUFFIX => '.zip', | ||||
| 563 | UNLINK => 1, | ||||
| 564 | $dir ? (DIR => $dir) : ()); | ||||
| 565 | return (undef, undef) unless $fh; | ||||
| 566 | my ($status, $newfh) = _newFileHandle($fh, 'w+'); | ||||
| 567 | $fh->close(); | ||||
| 568 | return ($newfh, $filename); | ||||
| 569 | } | ||||
| 570 | |||||
| 571 | # Return the normalized directory name as used in a zip file (path | ||||
| 572 | # separators become slashes, etc.). | ||||
| 573 | # Will translate internal slashes in path components (i.e. on Macs) to | ||||
| 574 | # underscores. Discards volume names. | ||||
| 575 | # When $forceDir is set, returns paths with trailing slashes (or arrays | ||||
| 576 | # with trailing blank members). | ||||
| 577 | # | ||||
| 578 | # If third argument is a reference, returns volume information there. | ||||
| 579 | # | ||||
| 580 | # input output | ||||
| 581 | # . ('.') '.' | ||||
| 582 | # ./a ('a') a | ||||
| 583 | # ./a/b ('a','b') a/b | ||||
| 584 | # ./a/b/ ('a','b') a/b | ||||
| 585 | # a/b/ ('a','b') a/b | ||||
| 586 | # /a/b/ ('','a','b') a/b | ||||
| 587 | # c:\a\b\c.doc ('','a','b','c.doc') a/b/c.doc # on Windows | ||||
| 588 | # "i/o maps:whatever" ('i_o maps', 'whatever') "i_o maps/whatever" # on Macs | ||||
| 589 | sub _asZipDirName { | ||||
| 590 | my $name = shift; | ||||
| 591 | my $forceDir = shift; | ||||
| 592 | my $volReturn = shift; | ||||
| 593 | my ($volume, $directories, $file) = | ||||
| 594 | File::Spec->splitpath(File::Spec->canonpath($name), $forceDir); | ||||
| 595 | $$volReturn = $volume if (ref($volReturn)); | ||||
| 596 | my @dirs = map { $_ =~ y{/}{_}; $_ } File::Spec->splitdir($directories); | ||||
| 597 | if (@dirs > 0) { pop(@dirs) unless $dirs[-1] } # remove empty component | ||||
| 598 | push(@dirs, defined($file) ? $file : ''); | ||||
| 599 | |||||
| 600 | #return wantarray ? @dirs : join ( '/', @dirs ); | ||||
| 601 | |||||
| 602 | my $normalised_path = join '/', @dirs; | ||||
| 603 | |||||
| 604 | # Leading directory separators should not be stored in zip archives. | ||||
| 605 | # Example: | ||||
| 606 | # C:\a\b\c\ a/b/c | ||||
| 607 | # C:\a\b\c.txt a/b/c.txt | ||||
| 608 | # /a/b/c/ a/b/c | ||||
| 609 | # /a/b/c.txt a/b/c.txt | ||||
| 610 | $normalised_path =~ s{^/}{}; # remove leading separator | ||||
| 611 | |||||
| 612 | return $normalised_path; | ||||
| 613 | } | ||||
| 614 | |||||
| 615 | # Return an absolute local name for a zip name. | ||||
| 616 | # Assume a directory if zip name has trailing slash. | ||||
| 617 | # Takes an optional volume name in FS format (like 'a:'). | ||||
| 618 | # | ||||
| 619 | sub _asLocalName { | ||||
| 620 | my $name = shift; # zip format | ||||
| 621 | my $volume = shift; | ||||
| 622 | $volume = '' unless defined($volume); # local FS format | ||||
| 623 | |||||
| 624 | my @paths = split(/\//, $name); | ||||
| 625 | my $filename = pop(@paths); | ||||
| 626 | $filename = '' unless defined($filename); | ||||
| 627 | my $localDirs = @paths ? File::Spec->catdir(@paths) : ''; | ||||
| 628 | my $localName = File::Spec->catpath($volume, $localDirs, $filename); | ||||
| 629 | unless ($volume) { | ||||
| 630 | $localName = File::Spec->rel2abs($localName, Cwd::getcwd()); | ||||
| 631 | } | ||||
| 632 | return $localName; | ||||
| 633 | } | ||||
| 634 | |||||
| 635 | 1 | 2µs | 1; | ||
| 636 | |||||
| 637 | __END__ |