@@ -79,12 +79,16 @@ @try { void *pool = objc_autoreleasePoolPush(); OFString *targetFileName; _fileName = [stringFromBuffer(header, 100) copy]; - _mode = (uint32_t)octalValueFromBuffer( - header + 100, 8, UINT32_MAX); + _mode = (uint16_t)octalValueFromBuffer( + header + 100, 8, UINT16_MAX); + _UID = (uint16_t)octalValueFromBuffer( + header + 108, 8, UINT16_MAX); + _GID = (uint16_t)octalValueFromBuffer( + header + 116, 8, UINT16_MAX); _size = (uint64_t)octalValueFromBuffer( header + 124, 12, UINT64_MAX); _modificationDate = [[OFDate alloc] initWithTimeIntervalSince1970: (of_time_interval_t)octalValueFromBuffer( @@ -186,14 +190,24 @@ - (OFString *)fileName { return _fileName; } -- (uint32_t)mode +- (uint16_t)mode { return _mode; } + +- (uint16_t)UID +{ + return _UID; +} + +- (uint16_t)GID +{ + return _GID; +} - (uint64_t)size { return _size; } @@ -237,21 +251,24 @@ { void *pool = objc_autoreleasePoolPush(); OFString *ret = [OFString stringWithFormat: @"<%@:\n" @"\tFile name = %@\n" @"\tMode = %06o\n" + @"\tUID = %u\n", + @"\tGID = %u\n", @"\tSize = %" PRIu64 @"\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, _size, _modificationDate, _type, - _targetFileName, _owner, _group, _deviceMajor, _deviceMinor]; + [self class], _fileName, _mode, _UID, _GID, _size, + _modificationDate, _type, _targetFileName, _owner, _group, + _deviceMajor, _deviceMinor]; [ret retain]; objc_autoreleasePoolPop(pool); @@ -264,12 +281,15 @@ uint64_t modificationDate; uint16_t checksum = 0; stringToBuffer(buffer, _fileName, 100); stringToBuffer(buffer + 100, - [OFString stringWithFormat: @"%06" PRIo32 " ", _mode], 8); - memcpy(buffer + 108, "000000 \0" "000000 \0", 16); + [OFString stringWithFormat: @"%06" PRIo16 " ", _mode], 8); + stringToBuffer(buffer + 108, + [OFString stringWithFormat: @"%06" PRIo16 " ", _UID], 8); + stringToBuffer(buffer + 116, + [OFString stringWithFormat: @"%06" PRIo16 " ", _GID], 8); stringToBuffer(buffer + 124, [OFString stringWithFormat: @"%011" PRIo64 " ", _size], 12); modificationDate = [_modificationDate timeIntervalSince1970]; stringToBuffer(buffer + 136, [OFString stringWithFormat: @"%011" PRIo64 " ", modificationDate],