Skip to content

Instantly share code, notes, and snippets.

@ferostabio
Created December 4, 2011 20:29
Show Gist options
  • Save ferostabio/1431192 to your computer and use it in GitHub Desktop.
Save ferostabio/1431192 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