withFileRegion(path:_:)

    Open file at path and query its size on a private thread pool, run an operation given the resulting file region and then close the file handle.

    NonBlockingFileIO.swift:1011
    iOS
    13+
    macOS
    10.15+
    tvOS
    13+
    watchOS
    6+
    func withFileRegion<Result>(path: String, _ body: (_ fileRegion: FileRegion) async throws -> Result) async throws -> Result

    Parameters

    path

    The path of the file to be opened for reading.

    body

    operation to run with file handle and region

    Returns

    return value of operation

    The will return the result of the operation.

    Other members in extension

    Types

    Type members

    Instance members