---
title: "seek(within:from:region:context:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsvolume/seekregionhandler/seek(within:from:region:context:replyhandler:)"
---

# seek(within:from:region:context:replyHandler:)

Find the next offset of hole or data region greater than or equal to the supplied offset

## Declaration

```swift
func seek(within item: FSItem, from offset: off_t, region: FSVolume.SeekRegion, context: FSContext, replyHandler reply: @escaping @Sendable (FSSeekRegionResult?, (any Error)?) -> Void)
```

```swift
func seek(within item: FSItem, from offset: off_t, region: FSVolume.SeekRegion, context: FSContext) async throws -> FSSeekRegionResult
```

## Parameters

- `item`: The item for which to seek.
- `offset`: The offset from which to seek.
- `region`: The region to seek.
- `context`: An object that enables context-aware file system decisions throughout the operation.
- `reply`: A block or closure to indicate success or failure. If seek succeeds, pass an instance of doc://FSKit/documentation/FSKit/FSSeekRegionResult containing the offset of the requested region greater than or equal to the supplied offset, along with a nil error. If seek fails, pass the relevant error as the second parameter; FSKit ignores the doc://FSKit/documentation/FSKit/FSSeekRegionResult instance in this case. For an async Swift implementation, there’s no reply handler; simply return the result instance or throw an error.

## See Also

### Performing seek

- [FSItem](fskit/fsitem.md)
- [FSVolume.SeekRegion](fskit/fsvolume/seekregion.md)
- [FSContext](fskit/fscontext.md)
- [FSSeekRegionResult](fskit/fsseekregionresult.md)
