Edit

Share via


NSFileManager.SetSkipBackupAttribute(String, Boolean) Method

Definition

public static Foundation.NSError SetSkipBackupAttribute (string filename, bool skipBackup);
static member SetSkipBackupAttribute : string * bool -> Foundation.NSError

Parameters

filename
String

Path of file

skipBackup
Boolean

True if you want to flag this file to be skipped for backups or false if you want to have this file backed up to iCloud.

Returns

A null return value will indicate success, while a non-null error will contain an instance of NSError detailing the problem

Remarks

If you set the SkipBackup attribute on a file, it will inform the operating system that this file should not be backed up into iCloud. This high-level API automagically adjust itself based on the version of iOS being executed. On iOS 5.0.1 (only) it will use the old setxattr API to set (or remove) the "com.apple.MobileBackup" attribute. On iOS 5.1 (and later) it will use NSUrlIsExcludedFromBackupKey to accomplish the same.

Applies to