I have a file system extension that currently uses the various now-deprecated Operations protocols. I have a few questions about moving to the new Handler protocols.
First, my module is going to maintain backwards compatibility with macOS Sequoia for the foreseeable future, but I would also like to be able to take advantage of new FSKit features for users who are on newer OS versions. What approach would you recommend:
- Having an FSVolume conform to both the various Operations and Handler protocols (e.g. both FSVolumeKernelOffloadedIOOperations and FSVolume.KernelOffloadedIOHandler with the latter tagged with
@available)- an immediate issue I see trying to do this is I run into the error
Method 'activate(options:)' with Objective-C selector 'activateWithOptions:replyHandler:' conflicts with previous declaration with the same Objective-C selectorwhen trying to conform to both FSVolume.Handler and FSVolume.Operations.
- an immediate issue I see trying to do this is I run into the error
- Having two separate FSVolume implementations, one used for older OS versions with Operations support and one used on newer OS versions with Handler support?
- Keeping the use of pre-existing Operations protocols while only using the Handlers for newer features (e.g. things like
SeekRegionHandler)
Second, I see at https://developer.apple.com/documentation/fskit/fsvolumehandlerresult/requestedattributes that I must populate all requested attributes. Does this value only have a meaning if the initializer for the actual concrete result type has an initializer that takes in a FSItem.Attributes instance, or is there some way I’m supposed to populate those? (As a concrete example, FSCheckAccessResult has init(accessAllowed:) which doesn’t take in any attributes.)