︙ | | | ︙ | |
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
_fileName = [stringFromBuffer(header, 100, encoding) copy];
_mode = (unsigned long)octalValueFromBuffer(
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(
header + 124, 12, ULLONG_MAX);
_modificationDate = [[OFDate alloc]
initWithTimeIntervalSince1970:
(OFTimeInterval)octalValueFromBuffer(
header + 136, 12, ULLONG_MAX)];
_type = header[156];
targetFileName = stringFromBuffer(header + 157, 100, encoding);
|
|
>
>
|
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
_fileName = [stringFromBuffer(header, 100, encoding) copy];
_mode = (unsigned long)octalValueFromBuffer(
header + 100, 8, ULONG_MAX);
_UID = (unsigned long)octalValueFromBuffer(
header + 108, 8, ULONG_MAX);
_GID = (unsigned long)octalValueFromBuffer(
header + 116, 8, ULONG_MAX);
_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];
targetFileName = stringFromBuffer(header + 157, 100, encoding);
|
︙ | | | ︙ | |
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
- (id)mutableCopy
{
OFTarArchiveEntry *copy = [[OFMutableTarArchiveEntry alloc]
initWithFileName: _fileName];
@try {
copy->_mode = _mode;
copy->_size = _size;
copy->_modificationDate = [_modificationDate copy];
copy->_type = _type;
copy->_targetFileName = [_targetFileName copy];
copy->_owner = [_owner copy];
copy->_group = [_group copy];
copy->_deviceMajor = _deviceMajor;
copy->_deviceMinor = _deviceMinor;
|
|
>
|
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
- (id)mutableCopy
{
OFTarArchiveEntry *copy = [[OFMutableTarArchiveEntry alloc]
initWithFileName: _fileName];
@try {
copy->_mode = _mode;
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];
copy->_deviceMajor = _deviceMajor;
copy->_deviceMinor = _deviceMinor;
|
︙ | | | ︙ | |
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
}
- (unsigned long)GID
{
return _GID;
}
- (unsigned long long)size
{
return _size;
}
- (OFDate *)modificationDate
{
return _modificationDate;
}
|
|
|
>
>
>
>
>
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
}
- (unsigned long)GID
{
return _GID;
}
- (unsigned long long)compressedSize
{
return _compressedSize;
}
- (unsigned long long)uncompressedSize
{
return _uncompressedSize;
}
- (OFDate *)modificationDate
{
return _modificationDate;
}
|
︙ | | | ︙ | |
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
{
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, _UID, _GID, _size, _modificationDate,
_type, _targetFileName, _owner, _group, _deviceMajor, _deviceMinor];
[ret retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
|
|
>
|
>
|
|
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
|
{
void *pool = objc_autoreleasePoolPush();
OFString *ret = [OFString stringWithFormat: @"<%@:\n"
@"\tFile name = %@\n"
@"\tMode = %06o\n"
@"\tUID = %u\n"
@"\tGID = %u\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, _compressedSize,
_uncompressedSize, _modificationDate, _type, _targetFileName,
_owner, _group, _deviceMajor, _deviceMinor];
[ret retain];
objc_autoreleasePoolPop(pool);
return [ret autorelease];
}
|
︙ | | | ︙ | |
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
stringToBuffer(buffer + 108,
[OFString stringWithFormat: @"%06" PRIo16 " ", _UID], 8,
OFStringEncodingASCII);
stringToBuffer(buffer + 116,
[OFString stringWithFormat: @"%06" PRIo16 " ", _GID], 8,
OFStringEncodingASCII);
stringToBuffer(buffer + 124,
[OFString stringWithFormat: @"%011" PRIo64 " ", _size], 12,
OFStringEncodingASCII);
modificationDate = _modificationDate.timeIntervalSince1970;
stringToBuffer(buffer + 136,
[OFString stringWithFormat: @"%011llo", modificationDate],
12, OFStringEncodingASCII);
/*
|
|
|
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
stringToBuffer(buffer + 108,
[OFString stringWithFormat: @"%06" PRIo16 " ", _UID], 8,
OFStringEncodingASCII);
stringToBuffer(buffer + 116,
[OFString stringWithFormat: @"%06" PRIo16 " ", _GID], 8,
OFStringEncodingASCII);
stringToBuffer(buffer + 124,
[OFString stringWithFormat: @"%011llo ", _uncompressedSize], 12,
OFStringEncodingASCII);
modificationDate = _modificationDate.timeIntervalSince1970;
stringToBuffer(buffer + 136,
[OFString stringWithFormat: @"%011llo", modificationDate],
12, OFStringEncodingASCII);
/*
|
︙ | | | ︙ | |