### Start File System Check Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations/startcheck%28task%3Aoptions%3A%29 Use this method to start a file system check operation. It requires a task object for client communication and options to configure the check. The method returns a `Progress` object to track the operation's status. ```swift func startCheck( task: FSTask, options: FSTaskOptions ) throws -> Progress ``` -------------------------------- ### Fetch Installed Extensions Source: https://developer.apple.com/documentation/fskit/fsclient Asynchronously retrieves a list of installed file system modules. Use this method to discover FSKit extensions. ```swift func fetchInstalledExtensions(completionHandler: ([FSModuleIdentity]?, (any Error)?) -> Void) ``` -------------------------------- ### fetchInstalledExtensions Source: https://developer.apple.com/documentation/fskit/fsmoduleidentity Asynchronously retrieves a list of installed file system modules. ```APIDOC ## func fetchInstalledExtensions(completionHandler: ([FSModuleIdentity]?, (any Error)?) -> Void) Asynchronously retrieves an list of installed file system modules. ``` -------------------------------- ### Fetch Installed Extensions Asynchronously Source: https://developer.apple.com/documentation/fskit/fsclient/fetchinstalledextensions%28completionhandler%3A%29 Alternatively, use the `async` property `installedExtensions` to retrieve installed file system modules in an asynchronous context. This property throws an error if the fetch operation fails. ```swift var installedExtensions: [FSModuleIdentity] { get async throws } ``` -------------------------------- ### installedExtensions (async/await) Source: https://developer.apple.com/documentation/fskit/fsclient/fetchinstalledextensions%28completionhandler%3A%29 Retrieves an list of installed file system modules using async/await. ```APIDOC ## installedExtensions ### Description Asynchronously retrieves a list of installed file system modules using the `async` keyword. ### Property Signature ```swift var installedExtensions: [FSModuleIdentity] { get async throws } ``` ### Discussion This property can be accessed using the `async` keyword for asynchronous retrieval of installed extensions. ``` -------------------------------- ### startCheck(task:options:) Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations/startcheck%28task%3Aoptions%3A%29 Starts checking the file system with the given options. This method is available on macOS 15.4+. ```APIDOC ## startCheck(task:options:) ### Description Starts checking the file system with the given options. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Method ```swift func startCheck( task: FSTask, options: FSTaskOptions ) throws -> Progress ``` ### Parameters * **task** (FSTask) - Required - A task object you use to communicate back to the client. * **options** (FSTaskOptions) - Required - Options for performing the check. ### Return Value An `Progress` object that you use to update progress as the check operation progresses. Return `nil` if starting the file system check encountered an error. ``` -------------------------------- ### fetchInstalledExtensions(completionHandler:) Source: https://developer.apple.com/documentation/fskit/fsclient/fetchinstalledextensions%28completionhandler%3A%29 Asynchronously retrieves a list of installed file system modules using a completion handler. ```APIDOC ## fetchInstalledExtensions(completionHandler:) ### Description Asynchronously retrieves a list of installed file system modules. ### Method Signature ```swift func fetchInstalledExtensions(completionHandler: @escaping @Sendable ([FSModuleIdentity]?, (any Error)?) -> Void) ``` ### Parameters #### completionHandler A block or closure that executes when FSKit finishes its fetch process. If the fetch succeeds, the first parameter contains an array of `FSModuleIdentity` instances that identify installed modules. If the fetch fails, the second parameter contains an error detailing the failure. ``` -------------------------------- ### Example Usage in Swift Source: https://developer.apple.com/documentation/fskit/fstask/cancellationhandler An example demonstrating how to set a cancellation handler for an FSTask in Swift, including custom logic for interruption and waiting on a dispatch group. ```APIDOC ## Swift Example ### Description This example shows how to implement a cancellation handler in Swift. The handler sets an `interrupted` flag and waits on a `DispatchGroup` to ensure cleanup operations complete before returning nil, indicating no error. ### Code ```swift // Assuming YourFileSystem and YourFileSystemCancelationContext are defined func startCheck(task: FSTask, options: FSTaskOptions) throws -> Progress { let someQueue = DispatchQueue.global() let progress = Progress() let checkContext = YourFileSystemCancelationContext() checkContext.work_group.enter() task.cancellationHandler = { checkContext.interrupted = true checkContext.work_group.wait() return nil } someQueue.async { self.performCheck(task: task, progress: progress, context:checkContext) } return progress } ``` ``` -------------------------------- ### Discovering installed extensions Source: https://developer.apple.com/documentation/fskit/fsclient Asynchronously retrieves a list of installed file system modules. ```APIDOC ## fetchInstalledExtensions ### Description Asynchronously retrieves an list of installed file system modules. ### Method `func fetchInstalledExtensions(completionHandler: ([FSModuleIdentity]?, (any Error)?) -> Void)` ### Parameters #### Completion Handler - `completionHandler`: A closure that is called with an optional array of `FSModuleIdentity` objects and an optional `Error` object. ``` -------------------------------- ### Fetch Installed Extensions with Completion Handler Source: https://developer.apple.com/documentation/fskit/fsclient/fetchinstalledextensions%28completionhandler%3A%29 Use this method to asynchronously retrieve an array of `FSModuleIdentity` instances representing installed file system modules. The completion handler receives either the array of modules or an error if the fetch fails. ```swift func fetchInstalledExtensions(completionHandler: @escaping @Sendable ([FSModuleIdentity]?, (any Error)?) -> Void) ``` -------------------------------- ### Formatting the file system Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations Starts formatting the file system with the given options. ```APIDOC ## startFormat ### Description Starts formatting the file system with the given options. ### Method func startFormat(task: FSTask, options: FSTaskOptions) throws -> Progress ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Progress** (Progress) - The progress of the formatting operation. #### Response Example None ``` -------------------------------- ### Example Usage in Objective-C Source: https://developer.apple.com/documentation/fskit/fstask/cancellationhandler An example demonstrating how to set a cancellation handler for an FSTask in Objective-C, including custom logic for interruption and waiting on a dispatch group. ```APIDOC ## Objective-C Example ### Description This example shows how to implement a cancellation handler in Objective-C. The handler sets an `interrupted` flag and waits on a `dispatch_group_t` to ensure cleanup operations complete before returning nil, indicating no error. ### Code ```objectivec // Assuming YourFileSystem and YourFileSystemCancelationContext are defined - (NSProgress * _Nullable)startCheckWithTask:(nonnull FSTask *)task options:(nonnull FSTaskOptions *)options error:(NSError *__autoreleasing _Nullable * _Nullable)error { dispatch_queue_t someQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); NSProgress *progress = [[NSProgress alloc] init]; YourFileSystemCancelationContext *checker= [[YourFileSystemCancelationContext alloc] init]; dispatch_group_enter(checker.work_group); [task setCancellationHandler:^NSError * _Nullable{ checker.interrupted = YES; dispatch_group_wait(checker.work_group, DISPATCH_TIME_FOREVER); return nil; }]; dispatch_async(someQueue, ^{[self performCheck:task progress:progress context:checker];}); return progress; } ``` ``` -------------------------------- ### startFormat(task:options:) Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations/startformat%28task%3Aoptions%3A%29 Starts formatting the file system with the specified task and options. Returns a Progress object to track the operation. ```APIDOC ## startFormat(task:options:) ### Description Starts formatting the file system with the given options. ### Method ```swift func startFormat( task: FSTask, options: FSTaskOptions ) throws -> Progress ``` ### Parameters #### Path Parameters - **task** (FSTask) - Required - A task object you use to communicate back to the client. - **options** (FSTaskOptions) - Required - Options for performing the format. ### Return Value An `Progress` object that you use to update progress as the format operation progresses. Return `nil` if starting to format the file system encountered an error. ``` -------------------------------- ### Checking the file system Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations Starts checking the file system with the given options. ```APIDOC ## startCheck ### Description Starts checking the file system with the given options. ### Method func startCheck(task: FSTask, options: FSTaskOptions) throws -> Progress ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Progress** (Progress) - The progress of the checking operation. #### Response Example None ``` -------------------------------- ### Start File System Format - FSKit Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations/startformat%28task%3Aoptions%3A%29 Use this method to begin formatting a file system. Provide a `FSTask` for client communication and `FSTaskOptions` to configure the operation. The returned `Progress` object allows for tracking the format's advancement. ```swift func startFormat( task: FSTask, options: FSTaskOptions ) throws -> Progress ``` -------------------------------- ### Optional didFinishLoading() Method Signature Source: https://developer.apple.com/documentation/fskit/fsunaryfilesystemoperations/didfinishloading%28%29 This is the signature for the optional didFinishLoading() method. Implement this method to perform setup tasks after the file system extension has loaded and before it receives its first message. ```swift optional func didFinishLoading() ``` -------------------------------- ### didFinishLoading() Source: https://developer.apple.com/documentation/fskit/fsunaryfilesystemoperations/didfinishloading%28%29 Notifies you that the system finished loading your file system extension. Implement this method if you want to perform any setup prior to receiving FSKit callbacks. ```APIDOC ## didFinishLoading() ### Description Notifies you that the system finished loading your file system extension. ### Signature ```swift optional func didFinishLoading() ``` ### Discussion The system performs this callback after the main run loop starts and before receiving the first message from the FSKit daemon. Implement this method if you want to perform any setup prior to receiving FSKit callbacks. ``` -------------------------------- ### Start File System Format Operation Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations Initiates a file system format operation. This method is required for implementations of the FSManageableResourceMaintenanceOperations protocol. ```swift func startFormat(task: FSTask, options: FSTaskOptions) throws -> Progress ``` -------------------------------- ### Accessing the startOffset Property Source: https://developer.apple.com/documentation/fskit/fsmetadatarange/startoffset Retrieve the starting byte offset of a file system range. This value must be a multiple of the resource's block size. ```swift var startOffset: off_t { get } ``` -------------------------------- ### init(url:) Source: https://developer.apple.com/documentation/fskit/fsgenericurlresource/init%28url%3A%29-2cmhi Creates a generic URL resource with the given URL. The format of this URL is completely arbitrary, and it's up to your extension to access the contents represented by the URL and make them available as an FSVolume that FSKit can load. ```APIDOC ## init(url:) ### Description Creates a generic URL resource with the given URL. ### Parameters #### Parameters - **url** (URL) - A URL that provides the content of the file system. The format of this URL is completely arbitrary. It’s up to your extension to access the contents represented by the URL and make them available as an `FSVolume` that FSKit can load. ``` -------------------------------- ### Start File System Check Operation Source: https://developer.apple.com/documentation/fskit/fsmanageableresourcemaintenanceoperations Initiates a file system check operation. This method is required for implementations of the FSManageableResourceMaintenanceOperations protocol. ```swift func startCheck(task: FSTask, options: FSTaskOptions) throws -> Progress ``` -------------------------------- ### FSKit Error Code Examples Source: https://developer.apple.com/documentation/fskit/fserror/code/resourceunusable This section lists related FSKit error codes for context. These examples illustrate different scenarios of resource and operation status. ```swift case invalidDirectoryCookie ``` ```swift case moduleLoadFailed ``` ```swift case resourceDamaged ``` ```swift case resourceUnrecognized ``` ```swift case statusOperationInProgress ``` ```swift case statusOperationPaused ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fspathurlresource/init%28url%3Awritable%3A%29-2l10q Creates a path URL resource with a specified URL and writability. ```APIDOC ## init(url:writable:) ### Description Creates a path URL resource. ### Parameters - **url** (URL) - A URL in the system file space that represents the contents of a file system. This parameter uses the `file:` scheme. - **writable** (Bool) - A Boolean value that indicates whether the file system supports writing to the contents of the URL. ``` -------------------------------- ### FSModuleIdentity Class Source: https://developer.apple.com/documentation/fskit/fsmoduleidentity Represents an installed file system module. ```APIDOC ## Class FSModuleIdentity An installed file system module. macOS 15.4+ ```swift class FSModuleIdentity ``` ### Accessing module properties - `var bundleIdentifier: String` The module’s bundle identifier. - `var url: URL` The module’s URL. - `var isEnabled: Bool` A Boolean value that indicates if the module is enabled. ``` -------------------------------- ### Initialize FSGenericURLResource with URL Source: https://developer.apple.com/documentation/fskit/fsgenericurlresource/init%28url%3A%29-2cmhi Creates a generic URL resource using the provided URL. The URL's format is arbitrary, and your extension is responsible for making its contents available as an `FSVolume`. ```swift init(url: URL) ``` -------------------------------- ### startOffset Source: https://developer.apple.com/documentation/fskit/fsmetadatarange/startoffset The start offset of the range in bytes. Available on macOS 15.4+. ```APIDOC ## startOffset The start offset of the range in bytes. ### Description The starting byte offset of the range. ### Declaration ```swift var startOffset: off_t { get } ``` ### Discussion Ensure this value is a multiple of the corresponding resource’s `blockSize`. ``` -------------------------------- ### Get Attributes Source: https://developer.apple.com/documentation/fskit/fsvolume/operations Fetches attributes for the given item. This is a required operation. ```APIDOC ## getAttributes ### Description Fetches attributes for the given item. ### Method `func getAttributes(FSItem.GetAttributesRequest, of: FSItem, replyHandler: (FSItem.Attributes?, (any Error)?) -> Void)` ### Parameters - **request**: `FSItem.GetAttributesRequest` - The request specifying which attributes to fetch. - **of**: `FSItem` - The item whose attributes are to be fetched. - **replyHandler**: `(FSItem.Attributes?, (any Error)?) -> Void` - A closure called with the item's `Attributes` and an `Error` if fetching fails. ``` -------------------------------- ### init(string:) Source: https://developer.apple.com/documentation/fskit/fsfilename/init%28string%3A%29 Creates a filename by copying a character sequence from a string instance. ```APIDOC ## init(string:) ### Description Creates a filename by copying a character sequence from a string instance. ### Signature ```swift convenience init(string name: String) ``` ### Parameters #### name - **name** (String) - The string containing the character sequence to use for the filename. ### Discussion This initializer copies the UTF-8 representation of the characters in `string`. If `string` contains a `NUL` character, the sequence terminates. ``` -------------------------------- ### init(volumeID:volumeName:) Source: https://developer.apple.com/documentation/fskit/fsvolume/init%28volumeid%3Avolumename%3A%29 Creates a volume with the given identifier and name. Available on macOS 15.4+. ```APIDOC ## init(volumeID:volumeName:) ### Description Creates a volume with the given identifier and name. ### Parameters #### Path Parameters * **volumeID** (FSVolume.Identifier) - Required - An `FSVolume.Identifier` to uniquely identify the volume. For a network file system that supports multiple authenticated users, disambiguate the users by using qualifying data in the identifier. * **volumeName** (FSFileName) - Required - A name for the volume. ``` -------------------------------- ### enumerateDirectory Source: https://developer.apple.com/documentation/fskit/fsdirectorycookie Enumerates the contents of a directory, using FSDirectoryCookie to specify the starting point. ```APIDOC ## Inspecting directory contents ### Description Enumerates the contents of the given directory. Your implementation of this method defines the semantics of the `FSDirectoryCookie` value, which is opaque to FSKit. ### Method `func enumerateDirectory(FSItem, startingAt: FSDirectoryCookie, verifier: FSDirectoryVerifier, attributes: FSItem.GetAttributesRequest?, packer: FSDirectoryEntryPacker, replyHandler: (FSDirectoryVerifier, (any Error)?) -> Void)` ### Parameters - `startingAt` (FSDirectoryCookie) - Required - A value that indicates a location in a directory from which to enumerate. - `verifier` (FSDirectoryVerifier) - Required - A tool to detect whether the directory contents changed since the last call to enumerate a directory. - `attributes` (FSItem.GetAttributesRequest?) - Optional - Specifies the attributes to retrieve for each item. - `packer` (FSDirectoryEntryPacker) - Required - An object used to provide items during a directory enumeration. - `replyHandler` ((FSDirectoryVerifier, (any Error)?) -> Void) - Required - A closure that is called with the verifier and an optional error. ``` -------------------------------- ### init(coder:) Source: https://developer.apple.com/documentation/fskit/fsitem/attributes/init%28coder%3A%29 Initializes an instance of FSItem.Attributes from the given decoder. This is part of the NSCoding protocol. ```APIDOC ## init(coder:) ### Description Initializes an instance of `FSItem.Attributes` from the given decoder. This method is part of the `NSCoding` protocol, allowing objects to be encoded and decoded. ### Method `init?(coder: NSCoder)` ### Parameters #### Parameters - **coder** (`NSCoder`) - The decoder to use for initializing the object. ### Availability macOS 15.4+ ``` -------------------------------- ### getXattr(named:of:) Source: https://developer.apple.com/documentation/fskit/fsvolume/xattroperations/getxattr%28named%3Aof%3Areplyhandler%3A%29 Gets the specified extended attribute of the given item asynchronously. ```APIDOC ## xattr(named:of:) ### Description Gets the specified extended attribute of the given item asynchronously. ### Parameters #### Path Parameters * **name** (FSFileName) - Required - The extended attribute name. * **item** (FSItem) - Required - The item for which to get the extended attribute. ### Response #### Success Response - **Data** - The extended attribute data. ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fsgenericurlresource/init%28url%3A%29-3957q Initializes a new instance of FSGenericURLResource with the specified URL. ```APIDOC ## init(URL:) ### Description Initializes a new instance of `FSGenericURLResource` with the specified URL. ### Parameters #### Parameters - **url** (URL) - The URL to associate with the resource. ``` -------------------------------- ### Create File with Async/Await Source: https://developer.apple.com/documentation/fskit/fsvolumekerneloffloadediooperations/createfile%28name%3Ain%3Aattributes%3Apacker%3Areplyhandler%3A%29 Use this asynchronous method to create a new file and map its disk space. It returns a tuple containing the created FSItem and its FSFileName upon success, or throws an error upon failure. ```swift func createFile( name: FSFileName, in directory: FSItem, attributes: FSItem.SetAttributesRequest, packer: FSExtentPacker ) async throws -> (FSItem, FSFileName) ``` -------------------------------- ### readInto:startingAt:length:completionHandler: Source: https://developer.apple.com/documentation/fskit/fsblockdeviceresource/readinto%3Astartingat%3Alength%3Acompletionhandler%3A Asynchronously reads a specified number of bytes from the resource into a buffer, starting at a given offset. A completion handler is executed upon completion, providing the number of bytes actually read or an error if the operation failed. ```APIDOC ## readInto:startingAt:length:completionHandler: ### Description Reads data from the resource into a buffer and executes a block afterwards. macOS 15.4+ ### Method Signature ```objective-c - (void) readInto:(void *) buffer startingAt:(off_t) offset length:(size_t) length completionHandler:(void (^)(size_t actuallyRead, NSError *error)) completionHandler; ``` ### Parameters * **buffer** (void *) - A buffer to receive the data. * **offset** (off_t) - The offset into the resource from which to start reading. * **length** (size_t) - A maximum number of bytes to read. The completion handler receives a parameter with the actual number of bytes read. * **completionHandler** (void (^)(size_t actuallyRead, NSError *error)) - A block that executes after the read operation completes. If successful, the first parameter contains the number of bytes actually read. In the case of an error, the second parameter contains a non-`nil` error. This value is `EFAULT` if `buffer` is `NULL`, or `errno` if reading from the resource failed. ### Discussion For the read to succeed, requests must conform to any transfer requirements of the underlying resource. Disk drives typically require sector (`physicalBlockSize`) addressed operations of one or more sector-aligned offsets. ``` -------------------------------- ### init(fileSystemTypeName:) Source: https://developer.apple.com/documentation/fskit/fsstatfsresult/init%28filesystemtypename%3A%29 Creates an statistics result instance, using the given file system type name. ```APIDOC ## init(fileSystemTypeName:) ### Description Creates an statistics result instance, using the given file system type name. ### Parameters #### Path Parameters - **fileSystemTypeName** (String) - Required - The name of the file system type. ``` -------------------------------- ### xattrs(of:) Source: https://developer.apple.com/documentation/fskit/fsvolume/xattroperations/listxattrs%28of%3Areplyhandler%3A%29 Gets the list of extended attributes currently set on the given item using async/await. ```APIDOC ## xattrs(of:) ### Description Gets the list of extended attributes currently set on the given item asynchronously. ### Parameters #### Path Parameters - **item** (FSItem) - Required - The item from which to get extended attributes. ### Response #### Success Response - **[FSFileName]** - An array of FSFileName instances representing the extended attributes. ### See Also - `func getXattr(named: FSFileName, of: FSItem, replyHandler: (Data?, (any Error)?) -> Void)` - `func setXattr(named: FSFileName, to: Data?, on: FSItem, policy: FSVolume.SetXattrPolicy, replyHandler: ((any Error)?) -> Void)` - `enum SetXattrPolicy` - `func supportedXattrNames(for: FSItem) -> [FSFileName]` ``` -------------------------------- ### Get bsdName Property Source: https://developer.apple.com/documentation/fskit/fsblockdeviceresource/bsdname Access the device name of the resource. Available on macOS 15.4 and later. ```swift var bsdName: String { get } ``` -------------------------------- ### Creating a usableButLimited Probe Result Source: https://developer.apple.com/documentation/fskit/fsproberesult/usablebutlimited Demonstrates how to create a probe result for a recognized file system that is usable, but with limited capabilities, using the `usableButLimited(name:containerID:)` class method. ```APIDOC ## See Also ### Working with results `class func usableButLimited(name: String, containerID: FSContainerIdentifier) -> Self` Creates a probe result for a recognized file system that is usable, but with limited capabilities. ``` -------------------------------- ### getXattr(named:of:replyHandler:) Source: https://developer.apple.com/documentation/fskit/fsvolume/xattroperations/getxattr%28named%3Aof%3Areplyhandler%3A%29 Gets the specified extended attribute of the given item using a completion handler. ```APIDOC ## getXattr(named:of:replyHandler:) ### Description Gets the specified extended attribute of the given item. ### Parameters #### Path Parameters * **name** (FSFileName) - Required - The extended attribute name. * **item** (FSItem) - Required - The item for which to get the extended attribute. * **reply** (@escaping @Sendable (Data?, (any Error)?) -> Void) - Required - A block or closure to indicate success or failure. If getting the attribute succeeds, pass an data instance containing the extended attribute data and a `nil` error. If getting the attribute fails, pass the relevant error as the second parameter; FSKit ignores any data in this case. For an `async` Swift implementation, there’s no reply handler; simply return the data or throw an error. ``` -------------------------------- ### Accessing the result Property Source: https://developer.apple.com/documentation/fskit/fsproberesult/result Access the `result` property to get the `FSMatchResult` of a probed resource. This property is read-only. ```swift var result: FSMatchResult { get } ``` -------------------------------- ### Get Module Bundle Identifier Source: https://developer.apple.com/documentation/fskit/fsmoduleidentity/bundleidentifier Access the bundle identifier of an FSModuleIdentity instance. Available on macOS 15.4+. ```swift var bundleIdentifier: String { get } ``` -------------------------------- ### Initializers Source: https://developer.apple.com/documentation/fskit/fsitem/attributes Initializes a new instance of FSItem.Attributes. ```APIDOC ## FSItem.Attributes ### Description Attributes of an item, such as size, creation and modification times, and user and group identifiers. ### Initializers `init?(coder: NSCoder)` ``` -------------------------------- ### Get FSItem Type Source: https://developer.apple.com/documentation/fskit/fsitem/attributes/type Access the type of an FSItem. This property is read-write and available on macOS 15.4 and later. ```swift var type: FSItem.ItemType { get set } ``` -------------------------------- ### Get FSItem Size Source: https://developer.apple.com/documentation/fskit/fsitem/attributes/size Retrieve the size of an FSItem. This property is read-write and returns the size in bytes as a UInt64. ```swift var size: UInt64 { get set } ``` -------------------------------- ### packEntry Source: https://developer.apple.com/documentation/fskit/fsdirectoryentrypacker Provides a directory entry during enumeration. This method is called by FSKit to get information about each item in a directory. ```APIDOC func packEntry(name: FSFileName, itemType: FSItem.ItemType, itemID: FSItem.Identifier, nextCookie: FSDirectoryCookie, attributes: FSItem.Attributes?) -> Bool Provides a directory entry during enumeration. ``` -------------------------------- ### activate(options:) async Source: https://developer.apple.com/documentation/fskit/fsvolume/operations/activate%28options%3Areplyhandler%3A%29 Activates the volume using the specified options asynchronously. This is the modern Swift async/await version. ```APIDOC ## activate(options:) ### Description Activates the volume using the specified options asynchronously. This method returns the `FSItem` on success or throws an error on failure. ### Method func activate(options: FSTaskOptions) async throws -> FSItem ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Parameters `options` (FSTaskOptions) - Required - Options to apply to the activation. These can include security-scoped file paths. There are no defined options currently. ### 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. ### See Also * `class FSItem` * `func deactivate(options: FSDeactivateOptions, replyHandler: ((any Error)?) -> Void)` * `struct FSDeactivateOptions` ``` -------------------------------- ### Initialize FSGenericURLResource with URL Source: https://developer.apple.com/documentation/fskit/fsgenericurlresource/init%28url%3A%29-3957q Use this initializer to create an instance of FSGenericURLResource by providing a URL. ```swift init(URL url: URL) ``` -------------------------------- ### FSDeactivateOptions Struct Definition Source: https://developer.apple.com/documentation/fskit/fsdeactivateoptions Defines the structure for deactivation options. This is a basic type definition and does not include usage examples. ```swift struct FSDeactivateOptions ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fsvolume/mountoptions/init%28rawvalue%3A%29 Initializes an FSVolume.MountOptions instance with a raw unsigned integer value. Available on macOS 26.4+. ```APIDOC ## init(rawValue:) ### Description Initializes an `FSVolume.MountOptions` instance with a raw unsigned integer value. ### Method Signature ```swift init(rawValue: UInt) ``` ### Parameters * `rawValue`: The `UInt` value to initialize the `MountOptions` with. ``` -------------------------------- ### Creating a generic URL resource Source: https://developer.apple.com/documentation/fskit/fsgenericurlresource Initializes a new FSGenericURLResource with a given URL. ```APIDOC ## Creating a generic URL resource `init(url: URL)` Creates a generic URL resource with the given URL. ``` -------------------------------- ### FSDirectoryVerifier initial Property Source: https://developer.apple.com/documentation/fskit/fsdirectoryverifier/initial This is the static initial value for the directory-enumeration verifier. It is used to set the starting state for verifications. ```swift static let initial: FSDirectoryVerifier ``` -------------------------------- ### FSUnaryFileSystem Source: https://developer.apple.com/documentation/fskit An abstract base class for implementing a minimal file system. ```APIDOC ## Class FSUnaryFileSystem ### Description An abstract base class for implementing a minimal file system. This class is intended to be subclassed by your file system implementation. ``` -------------------------------- ### listXattrs(of:replyHandler:) Source: https://developer.apple.com/documentation/fskit/fsvolume/xattroperations/listxattrs%28of%3Areplyhandler%3A%29 Gets the list of extended attributes currently set on the given item using a reply handler. ```APIDOC ## listXattrs(of:replyHandler:) ### Description Gets the list of extended attributes currently set on the given item. ### Parameters #### Path Parameters - **item** (FSItem) - Required - The item from which to get extended attributes. - **reply** (@escaping @Sendable ([FSFileName]?, (any Error)?) -> Void) - Required - A block or closure to indicate success or failure. If getting the list of extended attributes succeeds, pass the xattrs as an array of `FSFileName` instances and a `nil` error. If getting the attributes fails, pass `nil` along with the relevant error. ### See Also - `func getXattr(named: FSFileName, of: FSItem, replyHandler: (Data?, (any Error)?) -> Void)` - `func setXattr(named: FSFileName, to: Data?, on: FSItem, policy: FSVolume.SetXattrPolicy, replyHandler: ((any Error)?) -> Void)` - `enum SetXattrPolicy` - `func supportedXattrNames(for: FSItem) -> [FSFileName]` ``` -------------------------------- ### Declare GetAttributesRequest Class Source: https://developer.apple.com/documentation/fskit/fsitem/getattributesrequest Declares the GetAttributesRequest class, which is a request to get attributes from an item. Available on macOS 15.4+. ```swift class GetAttributesRequest ``` -------------------------------- ### FSVolume init(volumeID:volumeName:) Source: https://developer.apple.com/documentation/fskit/fsvolume/init%28volumeid%3Avolumename%3A%29 Creates a volume with the given identifier and name. Use this initializer to create a new volume instance. ```swift init( volumeID: FSVolume.Identifier, volumeName: FSFileName ) ``` -------------------------------- ### Get FSItem Access Time Source: https://developer.apple.com/documentation/fskit/fsitem/attributes/accesstime Retrieve the last-accessed time of an FSItem. This property is available on macOS 15.4 and later. ```swift var accessTime: timespec { get set } ``` -------------------------------- ### FSContainerState.ready Source: https://developer.apple.com/documentation/fskit/fscontainerstate/ready The container is ready, but inactive. Available on macOS 15.4+. ```APIDOC ## FSContainerState.ready ### Description The container is ready, but inactive. ### Platform macOS 15.4+ ### Code ```swift case ready ``` ``` -------------------------------- ### statusOperationPaused Property Source: https://developer.apple.com/documentation/fskit/fserror/statusoperationpaused Access the `statusOperationPaused` static property to get the error code for a paused operation. This is a read-only property. ```swift static var statusOperationPaused: FSError.Code { get } ``` -------------------------------- ### Get Container State Property Source: https://developer.apple.com/documentation/fskit/fscontainerstate Retrieves the current state of a container. This property returns a value of type FSContainerState. ```swift var state: FSContainerState ``` -------------------------------- ### Create a Ready Container Status Instance Source: https://developer.apple.com/documentation/fskit/fscontainerstatus/ready%28status%3A%29 Use this method to create a container status instance that signifies the container is ready. Provide an error status if applicable. ```swift class func ready(status errorStatus: any Error) -> Self ``` -------------------------------- ### Get Physical Block Size Source: https://developer.apple.com/documentation/fskit/fsblockdeviceresource/physicalblocksize Access the physicalBlockSize property to retrieve the sector size of the device. This property is read-only. ```swift var physicalBlockSize: UInt64 { get } ``` -------------------------------- ### Create FSPathURLResource with URL and Writable Flag Source: https://developer.apple.com/documentation/fskit/fspathurlresource/init%28url%3Awritable%3A%29-2l10q Use this initializer to create an `FSPathURLResource` instance. Provide a `file:` scheme URL and a boolean indicating if the resource is writable. ```swift init( url URL: URL, writable: Bool ) ``` -------------------------------- ### Get blockSize Property Source: https://developer.apple.com/documentation/fskit/fsblockdeviceresource/blocksize Retrieve the logical block size of the file system. This is equivalent to the DKIOCGETBLOCKSIZE device parameter. ```swift var blockSize: UInt64 { get } ``` -------------------------------- ### Preallocate Space (Callback) Source: https://developer.apple.com/documentation/fskit/fsvolume/preallocateoperations/preallocatespace%28for%3Aat%3Alength%3Aflags%3Areplyhandler%3A%29 Use this callback-based version to preallocate disk space. The reply handler is called with the number of bytes allocated or an error. ```swift func preallocateSpace( for item: FSItem, at offset: off_t, length: Int, flags: FSVolume.PreallocateFlags, replyHandler reply: @escaping @Sendable (Int, (any Error)?) -> Void ) ``` -------------------------------- ### Declare FSModuleIdentity Class Source: https://developer.apple.com/documentation/fskit/fsmoduleidentity Declares the FSModuleIdentity class, representing an installed file system module. Available on macOS 15.4+. ```swift class FSModuleIdentity ``` -------------------------------- ### Other FSError Codes Source: https://developer.apple.com/documentation/fskit/fserror/code/statusoperationinprogress Examples of other FSError codes, including invalid directory cookies, module load failures, and resource issues. ```swift case invalidDirectoryCookie ``` ```swift case moduleLoadFailed ``` ```swift case resourceDamaged ``` ```swift case resourceUnrecognized ``` ```swift case resourceUnusable ``` ```swift case statusOperationPaused ``` -------------------------------- ### init(cString:) Source: https://developer.apple.com/documentation/fskit/fsfilename/init%28cstring%3A%29 Creates a new `FSFileName` instance by copying the contents of a C-style string. This initializer is available on macOS 15.4 and later. ```APIDOC ## Initializer: init(cString:) ### Description Initializes an `FSFileName` instance by copying a C-style string. ### Signature `convenience init(cString name: UnsafeBufferPointer)` ### Availability macOS 15.4+ ### See Also - `convenience init(bytes: UnsafeBufferPointer)` - `convenience init(data: Data)` - `convenience init(string: String)` ``` -------------------------------- ### Access FSMetadataRange Properties Source: https://developer.apple.com/documentation/fskit/fsmetadatarange Accesses the properties of an FSMetadataRange object, including the start offset, segment length, and segment count. ```swift var startOffset: off_t ``` ```swift var segmentLength: UInt64 ``` ```swift var segmentCount: UInt64 ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fsdirectorycookie/init%28_%3A%29 Initializes an FSDirectoryCookie with a raw UInt64 value. Available on macOS 15.4+. ```APIDOC ## Initializer ### Description Initializes an `FSDirectoryCookie` with a raw `UInt64` value. ### Signature ```swift init(_ rawValue: UInt64) ``` ### Parameters #### Path Parameters - **rawValue** (UInt64) - Required - The raw unsigned 64-bit integer value to initialize the cookie with. ``` -------------------------------- ### Get Maximum Filename Component Length Source: https://developer.apple.com/documentation/fskit/fsvolume/pathconfoperations/maximumnamelength Retrieve the maximum length allowed for a component of a filename on the volume. This property is read-only. ```swift var maximumNameLength: Int { get } ``` -------------------------------- ### Get Maximum Link Count Source: https://developer.apple.com/documentation/fskit/fsvolume/pathconfoperations/maximumlinkcount Retrieve the maximum number of hard links supported for an object on the volume. This is a read-only property. ```swift var maximumLinkCount: Int { get } ``` -------------------------------- ### writeFrom:startingAt:length:error: Source: https://developer.apple.com/documentation/fskit/fsblockdeviceresource/writefrom%3Astartingat%3Alength%3Aerror%3A Synchronously writes data from a buffer to the resource. This method is the synchronous counterpart to writeFrom:startingAt:length:completionHandler:. ```APIDOC ## writeFrom:startingAt:length:error: ### Description Synchronously writes data from a buffer to the resource. This method is the synchronous counterpart to `writeFrom:startingAt:length:completionHandler:`. ### Method Signature ``` - (size_t) writeFrom:(void *) buffer startingAt:(off_t) offset length:(size_t) length error:(NSError **) error; ``` ### Parameters #### Parameters - **buffer** (void *) - The buffer to provide the data. - **offset** (off_t) - The offset into the resource from which to start writing. - **length** (size_t) - A maximum number of bytes to write. The completion handler receives a parameter with the actual number of bytes written. - **error** (NSError **) - On return, any error encountered while writing data, or `nil` if no error occurred. ### Return Value The actual number of bytes written. ### Discussion This is a synchronous version of `writeFrom:startingAt:length:completionHandler:`. Note In some cases, this method performs a partial write. In this case, the return value is shorter than the requested length, and the `error` is set to `nil`. ``` -------------------------------- ### Get Attributes with Async/Await Source: https://developer.apple.com/documentation/fskit/fsvolume/operations/getattributes%28_%3Aof%3Areplyhandler%3A%29 Fetches attributes for the given item using async/await. The function returns the attributes or throws an error. ```APIDOC ## getAttributes(_:of:) ### Description Fetches attributes for the given item using async/await. The function returns the attributes or throws an error. ### Method Signature ```swift func attributes( _ desiredAttributes: FSItem.GetAttributesRequest, of item: FSItem ) async throws -> FSItem.Attributes ``` ### Parameters #### Parameters - **desiredAttributes** (FSItem.GetAttributesRequest) - Required - A requested set of attributes to get. The implementation inspects the request’s `wantedAttributes` to determine which attributes to populate. - **item** (FSItem) - Required - The item to get attributes for. ### Discussion For file systems that don’t support hard links, set `linkCount` to `1` for regular files and symbolic links. If the item’s `bsdFlags` contain the `UF_COMPRESSED` flag, your file system returns the uncompressed size of the file. ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fspathurlresource/init%28url%3Awritable%3A%29-52fco Initializes an FSPathURLResource with a URL and a boolean value indicating whether the resource is writable. Available on macOS 26.0+. ```APIDOC ## init(URL:writable:) ### Description Initializes an FSPathURLResource with a URL and a boolean value indicating whether the resource is writable. ### Parameters - **URL** (URL) - The URL for the resource. - **writable** (Bool) - A boolean value indicating if the resource is writable. ### Availability macOS 26.0+ ``` -------------------------------- ### FSPathURLResource Initializers Source: https://developer.apple.com/documentation/fskit/fspathurlresource Initializers for creating an FSPathURLResource. ```APIDOC ## init(url: URL, writable: Bool) ### Description Creates a path URL resource. ### Parameters - **url** (URL) - The URL represented by the resource. - **writable** (Bool) - A Boolean value that indicates whether the file system supports writing to the contents of the path URL. ``` ```APIDOC ## init(URL: URL, writable: Bool) ### Description Creates a path URL resource. ### Parameters - **URL** (URL) - The URL represented by the resource. - **writable** (Bool) - A Boolean value that indicates whether the file system supports writing to the contents of the path URL. ``` -------------------------------- ### Get linkCount of an FSItem Source: https://developer.apple.com/documentation/fskit/fsitem/attributes/linkcount Access the linkCount property to retrieve the number of hard links associated with an FSItem. This is a read-write property. ```swift var linkCount: UInt32 { get set } ``` -------------------------------- ### Preallocate Space (Async/Throws) Source: https://developer.apple.com/documentation/fskit/fsvolume/preallocateoperations/preallocatespace%28for%3Aat%3Alength%3Aflags%3Areplyhandler%3A%29 Use this asynchronous version for preallocating disk space. It returns the number of bytes allocated or throws an error upon failure. ```swift func preallocateSpace( for item: FSItem, at offset: off_t, length: Int, flags: FSVolume.PreallocateFlags ) async throws -> Int ``` -------------------------------- ### Declare FSSyncFlags.noWait Source: https://developer.apple.com/documentation/fskit/fssyncflags/nowait Use this flag for synchronized I/O operations that should start immediately without waiting for completion. Available on macOS 15.4+. ```swift case noWait ``` -------------------------------- ### FSUnaryFileSystemExtension Source: https://developer.apple.com/documentation/fskit Implement a minimal file system as an app extension using the UnaryFileSystemExtension protocol. ```APIDOC ## Protocol UnaryFileSystemExtension ### Description A protocol for implementing a minimal file system as an app extension. ### Conformance Your app extension should conform to this protocol. ``` -------------------------------- ### Accessing FSMetadataRange Properties Source: https://developer.apple.com/documentation/fskit/fsmetadatarange Provides access to the properties of an FSMetadataRange object, including its start offset, segment length, and segment count. ```APIDOC ## Properties ### startOffset - **Type**: off_t - **Description**: The start offset of the range in bytes. ### segmentLength - **Type**: UInt64 - **Description**: The segment length in bytes. ### segmentCount - **Type**: UInt64 - **Description**: The number of segments in the range. ``` -------------------------------- ### openItem(_:modes:) Source: https://developer.apple.com/documentation/fskit/fsvolume/opencloseoperations/openitem%28_%3Amodes%3Areplyhandler%3A%29 Opens a file for access asynchronously. This is the async/await version. ```APIDOC ## func openItem(_:modes:) ### Description Opens a file for access asynchronously. ### Parameters - **item** (FSItem) - The item to open. - **modes** (FSVolume.OpenModes) - The set of mode flags to open the item with. ### Throws An error if opening the item fails. ``` -------------------------------- ### activate(options:replyHandler:) Source: https://developer.apple.com/documentation/fskit/fsvolume/operations/activate%28options%3Areplyhandler%3A%29 Activates the volume using the specified options and a reply handler. This is the callback-based version. ```APIDOC ## activate(options:replyHandler:) ### Description Activates the volume using the specified options and a reply handler. This method is used for callback-based operations. ### Method func activate( options: FSTaskOptions, replyHandler reply: @escaping @Sendable (FSItem?, (any Error)?) -> Void ) ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Parameters `options` (FSTaskOptions) - Required - Options to apply to the activation. These can include security-scoped file paths. There are no defined options currently. `reply` ((FSItem?, (any Error)?) -> Void) - Required - A block or closure to indicate success or failure. If activation succeeds, pass the root `FSItem` and a `nil` error. If activation fails, pass the relevant error as the second parameter; FSKit ignores any `FSItem` in this case. ### 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. ### See Also * `class FSItem` * `func deactivate(options: FSDeactivateOptions, replyHandler: ((any Error)?) -> Void)` * `struct FSDeactivateOptions` ``` -------------------------------- ### Create Item with Reply Handler Source: https://developer.apple.com/documentation/fskit/fsvolume/operations/createitem%28named%3Atype%3Aindirectory%3Aattributes%3Areplyhandler%3A%29 Use this callback-based version to create a new file or directory. Provide a reply handler to process the result, which includes the created item, its name, or any errors encountered. ```swift func createItem( named name: FSFileName, type: FSItem.ItemType, inDirectory directory: FSItem, attributes newAttributes: FSItem.SetAttributesRequest, replyHandler reply: @escaping @Sendable (FSItem?, FSFileName?, (any Error)?) -> Void ) ``` -------------------------------- ### Get Supported Extended Attribute Names Source: https://developer.apple.com/documentation/fskit/fsvolume/xattroperations Returns an array of extended attribute names that the given file system item supports. ```swift func supportedXattrNames(for: FSItem) -> [FSFileName] ``` -------------------------------- ### write(from:startingAt:length:) Source: https://developer.apple.com/documentation/fskit/fsblockdeviceresource/write%28from%3Astartingat%3Alength%3A%29-9oa1x Asynchronously writes data from a buffer to the resource. Requires macOS 15.4+. ```APIDOC ## write(from:startingAt:length:) ### Description Asynchronously writes data from a buffer to the resource. ### Method `async throws` ### Parameters #### Parameters - **buffer** (UnsafeRawBufferPointer) - The buffer to provide the data. - **offset** (off_t) - The offset into the resource from which to start writing. - **length** (Int) - A maximum number of bytes to write. The completion handler receives a parameter with the actual number of bytes written. ### Return Value The number of bytes written. ### Throws An error describing any write error. This value is `EFAULT` if `buffer` is `NULL`, or `errno` if writing to the resource failed. ### Discussion For the write to succeed, requests must conform to any transfer requirements of the underlying resource. Disk drives typically require sector (`physicalBlockSize`) addressed operations of one or more sector-aligned offsets. ``` -------------------------------- ### Get Extended Attribute Source: https://developer.apple.com/documentation/fskit/fsvolume/xattroperations Retrieves a specific extended attribute from a file system item. This is a required operation for volumes conforming to XattrOperations. ```swift func getXattr(named: FSFileName, of: FSItem, replyHandler: (Data?, (any Error)?) -> Void) ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fsitem/attribute/init%28rawvalue%3A%29 Initializes an FSItem.Attribute instance with the specified raw integer value. Available on macOS 15.4 and later. ```APIDOC ## init(rawValue:) ### Description Initializes an `FSItem.Attribute` instance with a raw integer value. ### Method `init(rawValue: Int)` ### Parameters #### Path Parameters - **rawValue** (Int) - The raw integer value to initialize the attribute with. ``` -------------------------------- ### Get File System Type Name Source: https://developer.apple.com/documentation/fskit/fsstatfsresult/filesystemtypename Access the file system type name. Match this value to the FSShortName attribute in the Info.plist. ```swift var fileSystemTypeName: String { get } ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fsvolume/preallocateflags/init%28rawvalue%3A%29 Initializes a new instance of FSVolume.PreallocateFlags with the specified raw value. Available on macOS 15.4+. ```APIDOC ## init(rawValue:) ### Description Initializes a `FSVolume.PreallocateFlags` instance with a raw unsigned integer value. ### Signature ```swift init(rawValue: UInt) ``` ### Parameters - **rawValue** (UInt) - The raw unsigned integer value to initialize the flags with. ``` -------------------------------- ### Get Data Buffer Length Source: https://developer.apple.com/documentation/fskit/fsmutablefiledatabuffer Retrieves the data length of the buffer. This property indicates the number of bytes currently stored in the buffer. ```swift var length: Int ``` -------------------------------- ### Create File with Reply Handler Source: https://developer.apple.com/documentation/fskit/fsvolumekerneloffloadediooperations/createfile%28name%3Ain%3Aattributes%3Apacker%3Areplyhandler%3A%29 Use this method to create a new file and map its disk space using a reply handler for asynchronous operations. The reply handler is called upon completion, indicating success or failure. ```swift func createFile( name: FSFileName, in directory: FSItem, attributes: FSItem.SetAttributesRequest, packer: FSExtentPacker, replyHandler reply: @escaping @Sendable (FSItem?, FSFileName?, (any Error)?) -> Void ) ``` -------------------------------- ### FSItem.Attribute.mode Property Source: https://developer.apple.com/documentation/fskit/fsitem/attribute/mode Access the static `mode` property to get the mode attribute for an FSItem. This property is available on macOS 15.4 and later. ```swift static var mode: FSItem.Attribute { get } ``` -------------------------------- ### FSItem.Attribute.size Property Source: https://developer.apple.com/documentation/fskit/fsitem/attribute/size Access the static `size` property of `FSItem.Attribute` to get the size attribute. This property is available on macOS 15.4 and later. ```swift static var size: FSItem.Attribute { get } ``` -------------------------------- ### Initializer Source: https://developer.apple.com/documentation/fskit/fsvolume/itemdeactivationoptions/init%28rawvalue%3A%29 Initializes the `ItemDeactivationOptions` with a raw unsigned integer value. Available on macOS 15.4 and later. ```APIDOC ## init(rawValue:) ### Description Initializes a new instance of `FSVolume.ItemDeactivationOptions` with a raw unsigned integer value. ### Signature ```swift init(rawValue: UInt) ``` ### Parameters - **rawValue** (UInt) - The raw unsigned integer value to initialize the options with. ### Availability macOS 15.4+ ``` -------------------------------- ### loadResource(resource:options:) Source: https://developer.apple.com/documentation/fskit/fsunaryfilesystemoperations/loadresource%28resource%3Aoptions%3Areplyhandler%3A%29 Requests that the file system load a resource and present it as a volume. This is the modern asynchronous version using async/await. ```APIDOC ## loadResource(resource:options:) ### Description Requests that the file system load a resource and present it as a volume using async/await. ### Method Signature ```swift func loadResource( resource: FSResource, options: FSTaskOptions ) async throws -> FSVolume ``` ### Parameters #### `resource` An `FSResource` to load. #### `options` An `FSTaskOptions` object specifying options to apply when loading the resource. Supported options include `-f` (force) and `--rdonly` (read-only). ### Returns An `FSVolume` object representing the loaded resource upon successful completion. ``` -------------------------------- ### Access the Shared FSClient Instance Source: https://developer.apple.com/documentation/fskit/fsclient/shared Use this class property to get the shared instance of the FSClient. Available on macOS 15.4 and later. ```swift class var shared: FSClient { get } ```