Instance Methodvapor 4.114.1Vapor

writeFile(_:at:)

Write the contents of buffer to a file at the supplied path.

FileIO.swift:457
func writeFile(_ buffer: ByteBuffer, at path: String) async throws

Parameters

buffer

The ByteBuffer to write.

path

Path to file on the disk.

let data = ByteBuffer(string: "ByteBuffer")
try await req.fileio.writeFile(data, at: "/path/to/file.txt")