Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (19 sloc) 0.63 kB
//
// NSFileHandle+ZKAdditions.m
// ZipKit
//
// Created by Karl Moskowski on 01/04/09.
//
#import "NSFileHandle+ZKAdditions.h"
@implementation NSFileHandle (ZKAdditions)
+ (NSFileHandle *)zk_newFileHandleForWritingAtPath:(NSString *)path {
NSFileManager *fm = [NSFileManager new];
if (![fm fileExistsAtPath:path]) {
[fm createDirectoryAtPath:[path stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:nil];
[fm createFileAtPath:path contents:nil attributes:nil];
}
NSFileHandle *fileHandle = [self fileHandleForWritingAtPath:path];
[fm release];
return fileHandle;
}
@end
Jump to Line
Something went wrong with that request. Please try again.