Differences From Artifact [fb0bc51e00]:
- File utils/ofarc/LHAArchive.m — part of check-in [1a86b8175b] at 2022-02-12 07:46:07 on branch trunk — Update copyright (user: js, size: 14123) [annotate] [blame] [check-ins using] [more...]
To Artifact [5f83697ea8]:
- File
utils/ofarc/LHAArchive.m
— part of check-in
[327e67021e]
at
2022-08-25 19:56:25
on branch trunk
— OFLHAArchiveEntry: Merge date and modificationDate
The date is meant to be the modification date and the extension is
supposed to override the modification date on old LHA versions where the
modification date is only stored in local time. (user: js, size: 13584) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
56 57 58 59 60 61 62 | ofItemAtPath: path]; #endif } static void setModificationDate(OFString *path, OFLHAArchiveEntry *entry) { | < | < < < < < < < < < < < < < | | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | ofItemAtPath: path]; #endif } static void setModificationDate(OFString *path, OFLHAArchiveEntry *entry) { OFFileAttributes attributes = [OFDictionary dictionaryWithObject: entry.modificationDate forKey: OFFileModificationDate]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; } @implementation LHAArchive + (void)initialize |
︙ | ︙ | |||
130 131 132 133 134 135 136 | while ((entry = [_archive nextEntry]) != nil) { void *pool = objc_autoreleasePoolPush(); [OFStdOut writeLine: entry.fileName]; if (app->_outputLevel >= 1) { | | | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | while ((entry = [_archive nextEntry]) != nil) { void *pool = objc_autoreleasePoolPush(); [OFStdOut writeLine: entry.fileName]; if (app->_outputLevel >= 1) { OFString *modificationDate = [entry.modificationDate localDateStringWithFormat: @"%Y-%m-%d %H:%M:%S"]; OFString *compressedSize = [OFString stringWithFormat: @"%" PRIu32, entry.compressedSize]; OFString *uncompressedSize = [OFString stringWithFormat: @"%" PRIu32, entry.uncompressedSize]; OFString *CRC16 = [OFString stringWithFormat: @"%04" PRIX16, entry.CRC16]; |
︙ | ︙ | |||
171 172 173 174 175 176 177 | @"Compression method: %[method]", @"method", entry.compressionMethod)]; [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED(@"list_crc16", @"CRC16: %[crc16]", @"crc16", CRC16)]; [OFStdOut writeString: @"\t"]; | | > | | | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | @"Compression method: %[method]", @"method", entry.compressionMethod)]; [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED(@"list_crc16", @"CRC16: %[crc16]", @"crc16", CRC16)]; [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED( @"list_modification_date", @"Modification date: %[date]", @"date", modificationDate)]; if (entry.mode != nil) { OFString *modeString = [OFString stringWithFormat: @"%ho", entry.mode.unsignedShortValue]; [OFStdOut writeString: @"\t"]; |
︙ | ︙ | |||
235 236 237 238 239 240 241 | [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED( @"list_osid", @"Operating system identifier: " "%[osid]", @"osid", OSID)]; } | < < < < < < < < < < < | 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED( @"list_osid", @"Operating system identifier: " "%[osid]", @"osid", OSID)]; } } if (app->_outputLevel >= 3) { OFString *extensions = indent(entry.extensions.description); [OFStdOut writeString: @"\t"]; |
︙ | ︙ | |||
467 468 469 470 471 472 473 | type = attributes.fileType; entry = [OFMutableLHAArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS entry.mode = [OFNumber numberWithUnsignedLong: attributes.filePOSIXPermissions]; #endif | | | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | type = attributes.fileType; entry = [OFMutableLHAArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS entry.mode = [OFNumber numberWithUnsignedLong: attributes.filePOSIXPermissions]; #endif entry.modificationDate = attributes.fileModificationDate; #ifdef OF_FILE_MANAGER_SUPPORTS_OWNER entry.UID = [OFNumber numberWithUnsignedLong: attributes.fileOwnerAccountID]; entry.GID = [OFNumber numberWithUnsignedLong: attributes.fileGroupOwnerAccountID]; entry.owner = attributes.fileOwnerAccountName; |
︙ | ︙ |