Skip to content

Instance Method

collectFile(at:)

Reads the contents of a file at the supplied path.
func collectFile(at path: String) async throws -> ByteBuffer

Parameters

path

Path to file on the disk.

Return Value

ByteBuffer containing the file data.

Discussion

let data = try await req.fileio.collectFile(file: "/path/to/file.txt")
print(data) // file data