<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "System",
  "identifier" : "/documentation/System/FileDescriptor/SeekOrigin",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "System"
    ],
    "preciseIdentifier" : "s:6System14FileDescriptorV10SeekOriginV"
  },
  "title" : "FileDescriptor.SeekOrigin"
}
-->

# FileDescriptor.SeekOrigin

Options for specifying what a file descriptor’s offset is relative to.

```
@frozen struct SeekOrigin
```

## Topics

### Creating a Seek Origin

[`static var current: FileDescriptor.SeekOrigin`](/documentation/System/FileDescriptor/SeekOrigin/current)

Indicates that the offset should be set
to the specified number of bytes after the current location.

[`static var end: FileDescriptor.SeekOrigin`](/documentation/System/FileDescriptor/SeekOrigin/end)

Indicates that the offset should be set
to the size of the file plus the specified number of bytes.

[`static var nextHole: FileDescriptor.SeekOrigin`](/documentation/System/FileDescriptor/SeekOrigin/nextHole)

Indicates that the offset should be set
to the next hole after the specified number of bytes.

[`static var nextData: FileDescriptor.SeekOrigin`](/documentation/System/FileDescriptor/SeekOrigin/nextData)

Indicates that the offset should be set
to the start of the next file region
that isn’t a hole
and is greater than or equal to the supplied offset.

[`static var start: FileDescriptor.SeekOrigin`](/documentation/System/FileDescriptor/SeekOrigin/start)

Indicates that the offset should be set to the specified value.

### Debugging

[`var description: String`](/documentation/System/FileDescriptor/SeekOrigin/description)

A textual representation of the seek origin.

[`var debugDescription: String`](/documentation/System/FileDescriptor/SeekOrigin/debugDescription)

A textual representation of the seek origin, suitable for debugging.

### Working with C APIs

[`init(rawValue: CInt)`](/documentation/System/FileDescriptor/SeekOrigin/init(rawValue:))

Create a strongly-typed seek origin from a raw C value.

[`var rawValue: CInt`](/documentation/System/FileDescriptor/SeekOrigin/rawValue)

The raw C value.

### Comparing Seek Origins

### Encoding Seek Origins

### Default Implementations

[CustomDebugStringConvertible Implementations](/documentation/System/FileDescriptor/SeekOrigin/CustomDebugStringConvertible-Implementations)

[CustomStringConvertible Implementations](/documentation/System/FileDescriptor/SeekOrigin/CustomStringConvertible-Implementations)

## Relationships

### Conforms To

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Encodable`](/documentation/Swift/Encodable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`Copyable`](/documentation/Swift/Copyable)

[`Escapable`](/documentation/Swift/Escapable)

[`Decodable`](/documentation/Swift/Decodable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)