42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS
if ((entry.versionMadeBy >> 8) ==
OF_ZIP_ARCHIVE_ENTRY_ATTR_COMPAT_UNIX) {
OFNumber *mode = [OFNumber numberWithUnsignedShort:
(entry.versionSpecificAttributes >> 16) & 0777];
of_file_attribute_key_t key =
of_file_attribute_key_posix_permissions;
of_file_attributes_t attributes = [OFDictionary
dictionaryWithObject: mode
forKey: key];
[[OFFileManager defaultManager] setAttributes: attributes
ofItemAtPath: path];
}
#endif
}
|
|
|
<
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS
if ((entry.versionMadeBy >> 8) ==
OF_ZIP_ARCHIVE_ENTRY_ATTR_COMPAT_UNIX) {
OFNumber *mode = [OFNumber numberWithUnsignedShort:
(entry.versionSpecificAttributes >> 16) & 0777];
of_file_attribute_key_t key =
of_file_attribute_key_posix_permissions;
of_file_attributes_t attributes =
[OFDictionary dictionaryWithObject: mode forKey: key];
[[OFFileManager defaultManager] setAttributes: attributes
ofItemAtPath: path];
}
#endif
}
|
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
}
directory = outFileName.stringByDeletingLastPathComponent;
if (![fileManager directoryExistsAtPath: directory])
[fileManager createDirectoryAtPath: directory
createParents: true];
if (![app shouldExtractFile: fileName
outFileName: outFileName])
goto outer_loop_end;
stream = [_archive streamForReadingFile: fileName];
output = [OFFile fileWithPath: outFileName
mode: @"w"];
setPermissions(outFileName, entry);
while (!stream.atEndOfStream) {
ssize_t length = [app copyBlockFromStream: stream
toStream: output
fileName: fileName];
|
|
<
|
<
|
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
}
directory = outFileName.stringByDeletingLastPathComponent;
if (![fileManager directoryExistsAtPath: directory])
[fileManager createDirectoryAtPath: directory
createParents: true];
if (![app shouldExtractFile: fileName outFileName: outFileName])
goto outer_loop_end;
stream = [_archive streamForReadingFile: fileName];
output = [OFFile fileWithPath: outFileName mode: @"w"];
setPermissions(outFileName, entry);
while (!stream.atEndOfStream) {
ssize_t length = [app copyBlockFromStream: stream
toStream: output
fileName: fileName];
|