Created
November 13, 2011 03:23
-
-
Save dennda/1361537 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSURL*)getDatasetRootFolder { | |
NSURL *appsupport = [[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory | |
inDomain:NSUserDomainMask | |
appropriateForURL:nil | |
create:YES | |
error:nil]; | |
NSURL *root = [appsupport URLByAppendingPathComponent:@"datasets" isDirectory:YES]; | |
BOOL is_directory; | |
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:root.absoluteString | |
isDirectory:&is_directory]; | |
if (!(exists && is_directory)) | |
[[NSFileManager defaultManager] createDirectoryAtURL:root | |
withIntermediateDirectories:YES | |
attributes:nil | |
error:nil]; | |
return root; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment