1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 10:51:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Exclude backup

This commit is contained in:
sunnylqm
2020-08-04 13:03:53 +08:00
parent 92c421b30f
commit 2d805fb38e

View File

@@ -24,6 +24,21 @@
return self;
}
- (BOOL)addSkipBackupAttributeToItemAtPath:(NSString *) filePathString
{
NSURL* URL= [NSURL fileURLWithPath: filePathString];
assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);
NSError *error = nil;
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
forKey: NSURLIsExcludedFromBackupKey error: &error];
if(!success){
NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
}
return success;
}
- (BOOL)createDir:(NSString *)dir
{
__block BOOL success = false;
@@ -48,7 +63,7 @@
return;
}
});
[self addSkipBackupAttributeToItemAtPath:dir];
return success;
}