withFileHandle(path:mode:flags:_:)

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

    NonBlockingFileIO.swift:1046
    iOS
    13+
    macOS
    10.15+
    tvOS
    13+
    watchOS
    6+
    func withFileHandle<Result>(path: String, mode: NIOFileHandle.Mode, flags: NIOFileHandle.Flags = .default, _ body: (NIOFileHandle) async throws -> Result) async throws -> Result

    Parameters

    path

    The path of the file to be opened for writing.

    mode

    File access mode.

    flags

    Additional POSIX flags.

    Returns

    return value of operation

    This function will return the result of the operation.

    Other members in extension

    Types

    Type members

    Instance members