Go to Latest
function writeBuffer
import { writeBuffer } from "https://deno.land/std@0.145.0/node/internal_binding/node_file.ts";

Write to the given file from the given buffer synchronously.

Implements sync part of WriteBuffer in src/node_file.cc See: https://github.com/nodejs/node/blob/e9ed113/src/node_file.cc#L1818

Parameters

fd: number

file descriptor

buffer: Uint8Array

the data to write

offset: number

where in the buffer to start from

length: number

how much to write

position: number | null

if integer, position to write at in the file. if null, write from the current position

ctx: { errno?: number; }

context object for passing error number