@@ -38,20 +38,20 @@ static void setPermissions(OFString *path, OFLHAArchiveEntry *entry) { #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS - OFNumber *mode = entry.mode; + OFNumber *POSIXPermissions = entry.POSIXPermissions; - if (mode == nil) + if (POSIXPermissions == nil) return; - mode = [OFNumber numberWithUnsignedShort: - mode.unsignedShortValue & 0777]; + POSIXPermissions = [OFNumber numberWithUnsignedShort: + POSIXPermissions.unsignedShortValue & 0777]; OFFileAttributes attributes = [OFDictionary - dictionaryWithObject: mode + dictionaryWithObject: POSIXPermissions forKey: OFFilePOSIXPermissions]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; #endif @@ -58,26 +58,12 @@ } static void setModificationDate(OFString *path, OFLHAArchiveEntry *entry) { - OFDate *modificationDate = entry.modificationDate; - OFFileAttributes attributes; - - if (modificationDate == nil) { - /* - * Fall back to the original date if we have no modification - * date, as the modification date is a UNIX extension. - */ - modificationDate = entry.date; - - if (modificationDate == nil) - return; - } - - attributes = [OFDictionary - dictionaryWithObject: modificationDate + OFFileAttributes attributes = [OFDictionary + dictionaryWithObject: entry.modificationDate forKey: OFFileModificationDate]; [[OFFileManager defaultManager] setAttributes: attributes ofItemAtPath: path]; } @@ -132,16 +118,16 @@ void *pool = objc_autoreleasePoolPush(); [OFStdOut writeLine: entry.fileName]; if (app->_outputLevel >= 1) { - OFString *date = [entry.date + OFString *modificationDate = [entry.modificationDate localDateStringWithFormat: @"%Y-%m-%d %H:%M:%S"]; OFString *compressedSize = [OFString stringWithFormat: - @"%" PRIu32, entry.compressedSize]; + @"%llu", entry.compressedSize]; OFString *uncompressedSize = [OFString stringWithFormat: - @"%" PRIu32, entry.uncompressedSize]; + @"%llu", entry.uncompressedSize]; OFString *CRC16 = [OFString stringWithFormat: @"%04" PRIX16, entry.CRC16]; [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED( @@ -173,49 +159,53 @@ [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED(@"list_crc16", @"CRC16: %[crc16]", @"crc16", CRC16)]; [OFStdOut writeString: @"\t"]; - [OFStdOut writeLine: OF_LOCALIZED(@"list_date", - @"Date: %[date]", - @"date", date)]; - - if (entry.mode != nil) { - OFString *modeString = [OFString - stringWithFormat: - @"%ho", entry.mode.unsignedShortValue]; - - [OFStdOut writeString: @"\t"]; - [OFStdOut writeLine: OF_LOCALIZED(@"list_mode", - @"Mode: %[mode]", - @"mode", modeString)]; - } - if (entry.UID != nil) { - [OFStdOut writeString: @"\t"]; - [OFStdOut writeLine: OF_LOCALIZED(@"list_uid", - @"UID: %[uid]", - @"uid", entry.UID)]; - } - if (entry.GID != nil) { + [OFStdOut writeLine: OF_LOCALIZED( + @"list_modification_date", + @"Modification date: %[date]", + @"date", modificationDate)]; + + if (entry.POSIXPermissions != nil) { + OFString *permissionsString = [OFString + stringWithFormat: @"%llo", + entry.POSIXPermissions + .unsignedLongLongValue]; + + [OFStdOut writeString: @"\t"]; + [OFStdOut writeLine: OF_LOCALIZED( + @"list_posix_permissions", + @"POSIX permissions: %[perm]", + @"perm", permissionsString)]; + } + if (entry.ownerAccountID != nil) { + [OFStdOut writeString: @"\t"]; + [OFStdOut writeLine: OF_LOCALIZED( + @"list_owner_account_id", + @"Owner account ID: %[id]", + @"id", entry.ownerAccountID)]; + } + if (entry.groupOwnerAccountID != nil) { [OFStdOut writeString: @"\t"]; [OFStdOut writeLine: OF_LOCALIZED(@"list_gid", - @"GID: %[gid]", - @"gid", entry.GID)]; - } - if (entry.owner != nil) { - [OFStdOut writeString: @"\t"]; - [OFStdOut writeLine: OF_LOCALIZED( - @"list_owner", - @"Owner: %[owner]", - @"owner", entry.owner)]; - } - if (entry.group != nil) { - [OFStdOut writeString: @"\t"]; - [OFStdOut writeLine: OF_LOCALIZED( - @"list_group", - @"Group: %[group]", - @"group", entry.group)]; + @"Group owner account ID: %[id]", + @"id", entry.groupOwnerAccountID)]; + } + if (entry.ownerAccountName != nil) { + [OFStdOut writeString: @"\t"]; + [OFStdOut writeLine: OF_LOCALIZED( + @"list_owner_account_name", + @"Owner account name: %[name]", + @"name", entry.ownerAccountName)]; + } + if (entry.groupOwnerAccountName != nil) { + [OFStdOut writeString: @"\t"]; + [OFStdOut writeLine: OF_LOCALIZED( + @"list_group_owner_account_name", + @"Group: %[name]", + @"name", entry.groupOwnerAccountName)]; } if (app->_outputLevel >= 2) { OFString *headerLevel = [OFString stringWithFormat: @"%" PRIu8, @@ -237,21 +227,10 @@ @"list_osid", @"Operating system identifier: " "%[osid]", @"osid", OSID)]; } - - if (entry.modificationDate != nil) { - OFString *modificationDate = - entry.modificationDate.description; - - [OFStdOut writeString: @"\t"]; - [OFStdOut writeLine: OF_LOCALIZED( - @"list_modification_date", - @"Modification date: %[date]", - @"date", modificationDate)]; - } } if (app->_outputLevel >= 3) { OFString *extensions = indent(entry.extensions.description); @@ -280,11 +259,11 @@ void *pool = objc_autoreleasePoolPush(); OFString *fileName = entry.fileName; OFString *outFileName, *directory; OFFile *output; OFStream *stream; - uint64_t written = 0, size = entry.uncompressedSize; + unsigned long long written = 0, size = entry.uncompressedSize; int8_t percent = -1, newPercent; if (!all && ![files containsObject: fileName]) continue; @@ -466,22 +445,24 @@ attributes = [fileManager attributesOfItemAtPath: fileName]; type = attributes.fileType; entry = [OFMutableLHAArchiveEntry entryWithFileName: fileName]; #ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS - entry.mode = [OFNumber numberWithUnsignedLong: - attributes.filePOSIXPermissions]; + entry.POSIXPermissions = + [attributes objectForKey: OFFilePOSIXPermissions]; #endif - entry.date = attributes.fileModificationDate; + 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; - entry.group = attributes.fileGroupOwnerAccountName; + entry.ownerAccountID = + [attributes objectForKey: OFFileOwnerAccountID]; + entry.groupOwnerAccountID = + [attributes objectForKey: OFFileGroupOwnerAccountID]; + entry.ownerAccountName = + [attributes objectForKey: OFFileOwnerAccountName]; + entry.groupOwnerAccountName = + [attributes objectForKey: OFFileGroupOwnerAccountName]; #endif if ([type isEqual: OFFileTypeDirectory]) { entry.compressionMethod = @"-lhd-";