---
title: "synchronize(flags:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsvolume/operations/synchronize(flags:replyhandler:)"
---

# synchronize(flags:replyHandler:)

Synchronizes the volume with its underlying resource.

## Declaration

```swift
func synchronize(flags: FSSyncFlags, replyHandler reply: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func synchronize(flags: FSSyncFlags) async throws
```

## Parameters

- `flags`: Timing flags, as defined in mount.h. These flags let the file system know whether to run the operation in a blocking or nonblocking fashion.
- `reply`: A block or closure to indicate success or failure. If synchronization fails, pass an error as the one parameter to the reply handler. If synchronization succeeds, pass nil. For an async Swift implementation, there’s no reply handler; simply throw an error or return normally.

## Discussion

Discussion After calling this method, FSKit assumes that the volume has sent all pending I/O or metadata to its resource.
