Required Instance Methodswift-nio 2.81.0_NIOFileSystem

openFile(forReadingAt:options:)

Opens the file at path for reading and returns a handle to it.

FileHandleProtocol.swift:586
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 directory to open relative to the open file.

options

How the file should be opened.

Returns

A read-only handle to the opened file.

If path is a relative path then it is opened relative to the handle. The file being opened must already exist otherwise this function will throw a FileSystemError with code notFound.