---
title: "seek(offset:from:)"
framework: system
role: symbol
role_heading: Instance Method
path: "system/filedescriptor/seek(offset:from:)"
---

# seek(offset:from:)

Repositions the offset for the given file descriptor.

## Declaration

```swift
@discardableResult func seek(offset: Int64, from whence: FileDescriptor.SeekOrigin) throws -> Int64
```

## Parameters

- `offset`: The new offset for the file descriptor.
- `whence`: The origin of the new offset.

## Return Value

Return Value The file’s offset location, in bytes from the beginning of the file.

## Discussion

Discussion The corresponding C function is lseek.

## See Also

### Changing a File’s Offset

- [FileDescriptor.SeekOrigin](system/filedescriptor/seekorigin.md)
