Skip to content

Instantly share code, notes, and snippets.

@carlosmcevilly
Forked from ferostabio/gist:1431192
Created May 9, 2012 03:28
Show Gist options
  • Save carlosmcevilly/2641563 to your computer and use it in GitHub Desktop.
Save carlosmcevilly/2641563 to your computer and use it in GitHub Desktop.
Avoid iCloud syncing
- (BOOL) addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment