@@ -103,12 +103,14 @@ header + 100, 8, ULONG_MAX); _UID = (unsigned long)octalValueFromBuffer( header + 108, 8, ULONG_MAX); _GID = (unsigned long)octalValueFromBuffer( header + 116, 8, ULONG_MAX); - _size = (unsigned long long)octalValueFromBuffer( + _uncompressedSize = (unsigned long long)octalValueFromBuffer( header + 124, 12, ULLONG_MAX); + _compressedSize = + _uncompressedSize + (512 - _uncompressedSize % 512); _modificationDate = [[OFDate alloc] initWithTimeIntervalSince1970: (OFTimeInterval)octalValueFromBuffer( header + 136, 12, ULLONG_MAX)]; _type = header[156]; @@ -173,11 +175,12 @@ OFTarArchiveEntry *copy = [[OFMutableTarArchiveEntry alloc] initWithFileName: _fileName]; @try { copy->_mode = _mode; - copy->_size = _size; + copy->_compressedSize = _compressedSize; + copy->_uncompressedSize = _uncompressedSize; copy->_modificationDate = [_modificationDate copy]; copy->_type = _type; copy->_targetFileName = [_targetFileName copy]; copy->_owner = [_owner copy]; copy->_group = [_group copy]; @@ -209,13 +212,18 @@ - (unsigned long)GID { return _GID; } -- (unsigned long long)size +- (unsigned long long)compressedSize +{ + return _compressedSize; +} + +- (unsigned long long)uncompressedSize { - return _size; + return _uncompressedSize; } - (OFDate *)modificationDate { return _modificationDate; @@ -257,21 +265,23 @@ OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tMode = %06o\n" @"\tUID = %u\n" @"\tGID = %u\n" - @"\tSize = %" PRIu64 @"\n" + @"\tCompressed size = %llu\n" + @"\tUncompressed size = %llu\n" @"\tModification date = %@\n" @"\tType = %u\n" @"\tTarget file name = %@\n" @"\tOwner = %@\n" @"\tGroup = %@\n" @"\tDevice major = %" PRIu32 @"\n" @"\tDevice minor = %" PRIu32 @"\n" @">", - self.class, _fileName, _mode, _UID, _GID, _size, _modificationDate, - _type, _targetFileName, _owner, _group, _deviceMajor, _deviceMinor]; + self.class, _fileName, _mode, _UID, _GID, _compressedSize, + _uncompressedSize, _modificationDate, _type, _targetFileName, + _owner, _group, _deviceMajor, _deviceMinor]; [ret retain]; objc_autoreleasePoolPop(pool); @@ -294,11 +304,11 @@ OFStringEncodingASCII); stringToBuffer(buffer + 116, [OFString stringWithFormat: @"%06" PRIo16 " ", _GID], 8, OFStringEncodingASCII); stringToBuffer(buffer + 124, - [OFString stringWithFormat: @"%011" PRIo64 " ", _size], 12, + [OFString stringWithFormat: @"%011llo ", _uncompressedSize], 12, OFStringEncodingASCII); modificationDate = _modificationDate.timeIntervalSince1970; stringToBuffer(buffer + 136, [OFString stringWithFormat: @"%011llo", modificationDate], 12, OFStringEncodingASCII);