openFile(forReadingAt:)

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

    FileSystemProtocol.swift:426
    iOS
    13.0+
    macOS
    10.15+
    tvOS
    13.0+
    watchOS
    6.0+
    func openFile(forReadingAt path: FilePath) async throws -> ReadFileHandle

    Parameters

    path

    The path of the file to open.

    Returns

    A readable handle to the opened file.

    The file being opened must exist otherwise this function will throw a FileSystemError with code notFound.

    See also

    Other members in extension

    Instance members

    Show obsolete interfaces (1)

    Hide obsolete interfaces