26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
static OFArc *app;
static void
setPermissions(OFString *destination, OFString *source)
{
#ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS
OFFileManager *fileManager = [OFFileManager defaultManager];
of_file_attributes_t attributes =
[fileManager attributesOfItemAtPath: source];
of_file_attribute_key_t key = of_file_attribute_key_posix_permissions;
of_file_attributes_t destinationAttributes = [OFDictionary
dictionaryWithObject: [attributes objectForKey: key]
forKey: key];
[fileManager setAttributes: destinationAttributes
ofItemAtPath: destination];
#endif
}
static void
setModificationDate(OFString *path, OFGZIPStream *stream)
{
OFDate *modificationDate = stream.modificationDate;
of_file_attributes_t attributes;
if (modificationDate == nil)
return;
attributes = [OFDictionary
dictionaryWithObject: modificationDate
forKey: of_file_attribute_key_modification_date];
[[OFFileManager defaultManager] setAttributes: attributes
ofItemAtPath: path];
}
@implementation GZIPArchive
+ (void)initialize
{
|
|
|
|
|
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
static OFArc *app;
static void
setPermissions(OFString *destination, OFString *source)
{
#ifdef OF_FILE_MANAGER_SUPPORTS_PERMISSIONS
OFFileManager *fileManager = [OFFileManager defaultManager];
OFFileAttributes attributes = [fileManager
attributesOfItemAtPath: source];
OFFileAttributeKey key = OFFilePOSIXPermissions;
OFFileAttributes destinationAttributes = [OFDictionary
dictionaryWithObject: [attributes objectForKey: key]
forKey: key];
[fileManager setAttributes: destinationAttributes
ofItemAtPath: destination];
#endif
}
static void
setModificationDate(OFString *path, OFGZIPStream *stream)
{
OFDate *modificationDate = stream.modificationDate;
OFFileAttributes attributes;
if (modificationDate == nil)
return;
attributes = [OFDictionary
dictionaryWithObject: modificationDate
forKey: OFFileModificationDate];
[[OFFileManager defaultManager] setAttributes: attributes
ofItemAtPath: path];
}
@implementation GZIPArchive
+ (void)initialize
{
|