mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-08-13 17:03:47 -04:00
1c384c5b3e
This reverts commit 55f114e3d499f510eadab5f918b7eb95fd9dd249, reversing changes made to 2809cd01dffb7f1a1df1068adaae8f2b1b44ae85.
27 lines
989 B
Objective-C
27 lines
989 B
Objective-C
#import <Foundation/Foundation.h>
|
|
int main(void) {
|
|
NSString *appSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject];
|
|
//If there isn't an App Support Directory yet ...
|
|
if (![[NSFileManager defaultManager] fileExistsAtPath:appSupportDir isDirectory:NULL]) {
|
|
NSError *error = nil;
|
|
//Create one
|
|
if (![[NSFileManager defaultManager] createDirectoryAtPath:appSupportDir withIntermediateDirectories:YES attributes:nil error:&error]) {
|
|
NSLog(@"%@", error.localizedDescription);
|
|
}
|
|
else {
|
|
// *** OPTIONAL *** Mark the directory as excluded from iCloud backups
|
|
NSURL *url = [NSURL fileURLWithPath:appSupportDir];
|
|
if (![url setResourceValue:@YES
|
|
forKey:NSURLIsExcludedFromBackupKey
|
|
error:&error])
|
|
{
|
|
NSLog(@"Error excluding %@ from backup %@", url.lastPathComponent, error.localizedDescription);
|
|
}
|
|
else {
|
|
NSLog(@"Yay");
|
|
}
|
|
}
|
|
}
|
|
printf("%s\n", [appSupportDir UTF8String]);
|
|
}
|