activate(options:replyHandler:)
Activates the volume using the specified options.
Declaration
func activate(options: FSTaskOptions, replyHandler reply: @escaping @Sendable (FSItem?, (any Error)?) -> Void)func activate(options: FSTaskOptions) async throws -> FSItemParameters
- options:
Options to apply to the activation. These can include security-scoped file paths. There are no defined options currently.
- reply:
A block or closure to indicate success or failure. If activation succeeds, pass the root Fsitem and a
nilerror. If activation fails, pass the relevant error as the second parameter; FSKit ignores any Fsitem in this case. In Swift,replytakes only the Fsitem as the parameter; you signal any error with athrow. For anasyncSwift implementation, there’s no reply handler; simply return the Fsitem or throw an error.
Discussion
When FSKit calls this method, allocate any in-memory state required to represent the file system. Also allocate an FSItem for the root directory of the file system, and pass it to the reply block. FSKit caches this root item for the lifetime of the volume, and uses it as a starting point for all file look-ups.
Volume activation occurs prior to any call to mount the volume.