<!--
{
  "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/read(fromAbsoluteOffset:into:retryOnInterrupt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "System"
    ],
    "preciseIdentifier" : "s:6System14FileDescriptorV4read18fromAbsoluteOffset4into16retryOnInterruptSis5Int64V_SwSbtKF"
  },
  "title" : "read(fromAbsoluteOffset:into:retryOnInterrupt:)"
}
-->

# read(fromAbsoluteOffset:into:retryOnInterrupt:)

Reads bytes at the specified offset into a buffer.

```
func read(fromAbsoluteOffset offset: Int64, into buffer: UnsafeMutableRawBufferPointer, retryOnInterrupt: Bool = true) throws -> Int
```

## Parameters

`offset`

The file offset where reading begins.

`buffer`

The region of memory to read into.

`retryOnInterrupt`

Whether to retry the read operation
if it throws [`interrupted`](/documentation/System/Errno/interrupted).
The default is `true`.
Pass `false` to try only once and throw an error upon interruption.

## Return Value

The number of bytes that were read.

## Discussion

The <doc://com.apple.documentation/documentation/Swift/UnsafeMutableRawBufferPointer/count> property of `buffer`
determines the maximum number of bytes that are read into that buffer.

Unlike [`read(into:retryOnInterrupt:)`](/documentation/System/FileDescriptor/read(into:retryOnInterrupt:)),
this method leaves the file’s existing offset unchanged.

The corresponding C function is `pread`.

---

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)