Commit 59599289 authored by Alexey.Musinov's avatar Alexey.Musinov

utils

parent 5157908b
......@@ -42,4 +42,5 @@
@interface NSFileManager (Utils)
- (BOOL)copyFolderAtPath:(NSString *)sourceFolder toDestinationFolderAtPath:(NSString*)destinationFolder;
- (NSString*)createTemporaryDirectory;
- (void)createDirectory:(NSString*)directory;
@end
......@@ -68,7 +68,7 @@
NSError *error = nil;
NSString* path = [NSString stringWithFormat:@"%@%@", NSTemporaryDirectory(), [NSUUID UUID].UUIDString];
if(![[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error])
if(![self createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error])
{
NSLog(@"Could not creat temp path %@. error %@", path, error);
return @"";
......@@ -77,4 +77,11 @@
return path;
}
- (void)createDirectory:(NSString*)directory {
NSError *error = nil;
if(![self createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:&error]) {
NSLog(@"Failed to create directory \"%@\". Error: %@", directory, error);
}
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment