Differences From Artifact [251b5d4973]:
- File utils/ofarc/ZIPArchive.m — part of check-in [bc158ffe75] at 2020-06-02 21:02:57 on branch set-mtime — ofarc: Set modification date of extracted files (user: js, size: 13471) [annotate] [blame] [check-ins using] [more...]
To Artifact [4b4d3715d0]:
- File
utils/ofarc/ZIPArchive.m
— part of check-in
[25c985fec1]
at
2020-08-25 00:11:24
on branch trunk
— OFNumber: Remove (u)int{8,16,32,64} methods
Since C guarantees minimum sizes for char, short, int, long and long
long, these can be used instead. (user: js, size: 13516) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
40 41 42 43 44 45 46 | static void setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS if ((entry.versionMadeBy >> 8) == OF_ZIP_ARCHIVE_ENTRY_ATTR_COMPAT_UNIX) { | > | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | static void setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS if ((entry.versionMadeBy >> 8) == OF_ZIP_ARCHIVE_ENTRY_ATTR_COMPAT_UNIX) { OFNumber *mode = [OFNumber numberWithUnsignedShort: (entry.versionSpecificAttributes >> 16) & 0777]; of_file_attribute_key_t key = of_file_attribute_key_posix_permissions; of_file_attributes_t attributes = [OFDictionary dictionaryWithObject: mode forKey: key]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; } #endif } |
︙ | ︙ | |||
134 135 136 137 138 139 140 | stringWithFormat: @"%08" PRIX32, entry.CRC32]; OFString *modificationDate = [entry.modificationDate localDateStringWithFormat: @"%Y-%m-%d %H:%M:%S"]; [of_stdout writeString: @"\t"]; [of_stdout writeLine: OF_LOCALIZED( @"list_compressed_size", | | | | | | | | | | | | | | | | 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | stringWithFormat: @"%08" PRIX32, entry.CRC32]; OFString *modificationDate = [entry.modificationDate localDateStringWithFormat: @"%Y-%m-%d %H:%M:%S"]; [of_stdout writeString: @"\t"]; [of_stdout writeLine: OF_LOCALIZED( @"list_compressed_size", @"[" @" 'Compressed: '," @" [" @" {'size == 1': '1 byte'}," @" {'': '%[size] bytes'}" @" ]" @"]".objectByParsingJSON, @"size", compressedSize)]; [of_stdout writeString: @"\t"]; [of_stdout writeLine: OF_LOCALIZED( @"list_uncompressed_size", @"[" @" 'Uncompressed: '," @" [" @" {'size == 1': '1 byte'}," @" {'': '%[size] bytes'}" @" ]" @"]".objectByParsingJSON, @"size", uncompressedSize)]; [of_stdout writeString: @"\t"]; [of_stdout writeLine: OF_LOCALIZED( @"list_compression_method", @"Compression method: %[method]", @"method", compressionMethod)]; [of_stdout writeString: @"\t"]; |
︙ | ︙ | |||
417 418 419 420 421 422 423 | for (OFString *localFileName in files) { void *pool = objc_autoreleasePoolPush(); OFArray OF_GENERIC (OFString *) *components; OFString *fileName; of_file_attributes_t attributes; bool isDirectory = false; OFMutableZIPArchiveEntry *entry; | | | 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 | for (OFString *localFileName in files) { void *pool = objc_autoreleasePoolPush(); OFArray OF_GENERIC (OFString *) *components; OFString *fileName; of_file_attributes_t attributes; bool isDirectory = false; OFMutableZIPArchiveEntry *entry; unsigned long long size; OFStream *output; components = localFileName.pathComponents; fileName = [components componentsJoinedByString: @"/"]; attributes = [fileManager attributesOfItemAtPath: localFileName]; |
︙ | ︙ | |||
454 455 456 457 458 459 460 | entry.modificationDate = attributes.fileModificationDate; [entry makeImmutable]; output = [_archive streamForWritingEntry: entry]; if (!isDirectory) { | | | 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | entry.modificationDate = attributes.fileModificationDate; [entry makeImmutable]; output = [_archive streamForWritingEntry: entry]; if (!isDirectory) { unsigned long long written = 0; int8_t percent = -1, newPercent; OFFile *input = [OFFile fileWithPath: fileName mode: @"r"]; while (!input.atEndOfStream) { ssize_t length = [app |
︙ | ︙ |