<!--
{
  "availability" : [
    "macOS: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSTask",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(cs)FSTask"
  },
  "title" : "FSTask"
}
-->

# FSTask

A class that enables a file system module to pass log messages and completion notifications to clients.

```
class FSTask
```

## Overview

FSKit creates an instance of this class for each long-running operations.

## Topics

### Logging

[`logMessage(_:)`](/documentation/FSKit/FSTask/logMessage(_:))

Logs the given string to the initiating client.

### Sending completion messages

[`didComplete(error:)`](/documentation/FSKit/FSTask/didComplete(error:))

Informs the client that the task completed.

### Handling task cancellation

[`cancellationHandler`](/documentation/FSKit/FSTask/cancellationHandler)

A handler called by FSKit upon canceling the task.



---

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)