<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFURLSetResourcePropertiesForKeys(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFURLSetResourcePropertiesForKeys"
  },
  "title" : "CFURLSetResourcePropertiesForKeys(_:_:_:)"
}
-->

# CFURLSetResourcePropertiesForKeys(_:_:_:)

Sets the URL’s resource properties for a given set of keys to a given set of values.

```
func CFURLSetResourcePropertiesForKeys(_ url: CFURL!, _ keyedPropertyValues: CFDictionary!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool
```

## Parameters

`url`

The URL.

`keyedPropertyValues`

A dictionary of resource values to be set.

`error`

The error that occurred if one or more resource values could not be set.

## Return Value

`true` if all resource values in `keyedValues` are successfully set; otherwise, `false`.

## Discussion

This function synchronously writes the new resource value out to disk. If an error occurs after some resource properties have been successfully changed, the `userInfo` dictionary in the returned error object contains a `kCFURLKeysOfUnsetValuesKey` key whose value is an array of the resource values that were not successfully set.

Attempts to set a read-only resource property or to set a resource property that is not supported by the resource are ignored and are not considered errors.

The order in which the resource values are set is not defined. If you need to guarantee the order in which resource values are set, you should make multiple requests to this function or [`CFURLSetResourcePropertyForKey(_:_:_:_:)`](/documentation/CoreFoundation/CFURLSetResourcePropertyForKey(_:_:_:_:)).

> Note:
> This method applies only to URLs for file system resources.

## See Also

[`CFURL`](/documentation/CoreFoundation/CFURL)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)