@@ -20,10 +20,11 @@ #import "OFApplication.h" #import "OFArray.h" #import "OFDate.h" #import "OFFile.h" +#import "OFFileManager.h" #import "OFOptionsParser.h" #import "OFSet.h" #import "OFStdIOStream.h" #import "OFZIPArchive.h" #import "OFZIPArchiveEntry.h" @@ -95,12 +96,13 @@ uint32_t mode = [entry versionSpecificAttributes] >> 16; /* Only allow modes that are safe */ mode &= (S_IRWXU | S_IRWXG | S_IRWXO); - [OFFile changePermissionsOfItemAtPath: path - permissions: mode]; + [[OFFileManager defaultManager] + changePermissionsOfItemAtPath: path + permissions: mode]; } #endif } @implementation OFZIP @@ -282,10 +284,11 @@ } - (void)extractFiles: (OFArray OF_GENERIC(OFString*)*)files fromArchive: (OFZIPArchive*)archive { + OFFileManager *fileManager = [OFFileManager defaultManager]; OFEnumerator OF_GENERIC(OFZIPArchiveEntry*) *entryEnumerator; OFZIPArchiveEntry *entry; bool all; OFMutableSet OF_GENERIC(OFString*) *missing; @@ -339,26 +342,27 @@ if (_outputLevel >= 0) [of_stdout writeFormat: @"Extracting %@...", fileName]; if ([fileName hasSuffix: @"/"]) { - [OFFile createDirectoryAtPath: outFileName - createParents: true]; + [fileManager createDirectoryAtPath: outFileName + createParents: true]; setPermissions(outFileName, entry); if (_outputLevel >= 0) [of_stdout writeLine: @" done"]; goto outer_loop_end; } directory = [outFileName stringByDeletingLastPathComponent]; - if (![OFFile directoryExistsAtPath: directory]) - [OFFile createDirectoryAtPath: directory - createParents: true]; + if (![fileManager directoryExistsAtPath: directory]) + [fileManager createDirectoryAtPath: directory + createParents: true]; - if ([OFFile fileExistsAtPath: outFileName] && _override != 1) { + if ([fileManager fileExistsAtPath: outFileName] && + _override != 1) { OFString *line; if (_override == -1) { if (_outputLevel >= 0) [of_stdout writeLine: @" skipped"];