Contents

extendedAttributes

The extended file attributes synced by the File Provider extension.

Declaration

optional var extendedAttributes: [String : Data] { get }

Discussion

The extended file attributes are part of the item’s metadata. The system sets extended attributes on dataless files, and preserves them on files that it renders dataless. The system decides which attributes to sync. To sync an attribute, it calls the xattr_name_with_flags(_:_:) method and passes the XATTR_FLAG_SYNCABLE flag. Some older attributes are also synced.

The system caps the syncable extended attributes to about 32KiB total for each item. If the extended attributes exceed this limit, the system automatically makes some of the attributes nonsyncable.

The system also decides which nonsyncable attributes it preserves on the local copy when a remote item changes. For example, it preserves attributes created by calling xattr_name_with_flags(_:_:) and passing XATTR_FLAG_CONTENT_DEPENDENT as long as the remote change didn’t modify the contentVersion property for the item’s version.

This dictionary doesn’t list extended attributes that are already covered by NSFileProviderItemFields values, like lastUsedDate or tagData. Similarly, the dictionary doesn’t include the 32 bits of Finder info stored in an extended attribute named com.apple.FinderInfo, because this information exists in other NSFileProviderItemProtocol properties.

Also, the resource fork is content and isn’t included in the extended attributes dictionary. If your extension detects remote changes to the resource fork, report these changes by modifying the item version’s contentVersion property.

See Also

Managing Metadata