I'm testing some code I wrote to set the isExcludedFromBackup flag on a URL. I 
tried putting the code into a playground to test various uses of it. But when 
it goes to set the flag, it gets an error:

Error setting isExcludedFromBackup: Error Domain=NSCocoaErrorDomain Code=513 
"You don’t have permission to save the file “test” in the folder “rmann”." 
UserInfo={NSURLUnsetValueKeysKey=(
    NSURLIsExcludedFromBackupKey
), NSURL=file:///Users/rmann/test/, NSFilePath=/Users/rmann/test, 
NSUnderlyingError=0x60000005f7d0 {Error Domain=NSPOSIXErrorDomain Code=1 
"Operation not permitted"}}

The code is basically:

    var vals = URLResourceValues()
    vals.isExcludedFromBackup = true
    try url.setResourceValues(vals)

The folder I'm setting it on is in my home directory.

It's an iOS playground.

Any ideas? Thanks.

-- 
Rick Mann
rm...@latencyzero.com



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to