Differences From Artifact [6652b0186c]:
- File
utils/ofarc/ZIPArchive.m
— part of check-in
[94c326ab78]
at
2022-08-27 20:33:53
on branch trunk
— OFZIPArchiveEntry: Make (un)compressedSize ull
This is for consistency with OFTarArchiveEntry and OFLHAArchiveEntry. (user: js, size: 13321) [annotate] [blame] [check-ins using] [more...]
To Artifact [110299511c]:
- File utils/ofarc/ZIPArchive.m — part of check-in [8939cbdb52] at 2023-01-06 09:04:02 on branch trunk — Update copyright (user: js, size: 13388) [annotate] [blame] [check-ins using] [more...]
1 | /* | | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008-2023 Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #import "ZIPArchive.h" #import "OFArc.h" #import "OFInvalidFormatException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" static OFArc *app; static void setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS | > | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #import "ZIPArchive.h" #import "OFArc.h" #import "OFInvalidFormatException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFSetItemAttributesFailedException.h" static OFArc *app; static void setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS |
︙ | ︙ | |||
62 63 64 65 66 67 68 | if (modificationDate == nil) return; attributes = [OFDictionary dictionaryWithObject: modificationDate forKey: OFFileModificationDate]; | > | | > > > > | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | if (modificationDate == nil) return; attributes = [OFDictionary dictionaryWithObject: modificationDate forKey: OFFileModificationDate]; @try { [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; } @catch (OFSetItemAttributesFailedException *e) { if (e.errNo != EISDIR) @throw e; } } @implementation ZIPArchive + (void)initialize { if (self == [ZIPArchive class]) app = (OFArc *)[OFApplication sharedApplication].delegate; |
︙ | ︙ | |||
435 436 437 438 439 440 441 | [OFStdOut writeString: OF_LOCALIZED(@"adding_file", @"Adding %[file]...", @"file", fileName)]; entry = [OFMutableZIPArchiveEntry entryWithFileName: fileName]; size = (isDirectory ? 0 : attributes.fileSize); | < < < | 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | [OFStdOut writeString: OF_LOCALIZED(@"adding_file", @"Adding %[file]...", @"file", fileName)]; entry = [OFMutableZIPArchiveEntry entryWithFileName: fileName]; size = (isDirectory ? 0 : attributes.fileSize); entry.compressedSize = size; entry.uncompressedSize = size; entry.compressionMethod = OFZIPArchiveEntryCompressionMethodNone; entry.modificationDate = attributes.fileModificationDate; |
︙ | ︙ |