openFile(forReadingAt:options:)

Open the file at path for reading.

FileSystem.swift:106
iOS
13.0+
macOS
10.15+
tvOS
13.0+
watchOS
6.0+
func openFile(forReadingAt path: FilePath, options: OpenOptions.Read) async throws -> ReadFileHandle

Parameters

path

The path of the file to open.

options

How the file should be opened.

Returns

A readable handle to the opened file.

Errors

Error codes thrown include:

Implementation details

Uses the open(2) system call.