Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function writeBufferSync
import { writeBufferSync } from "https://deno.land/std@0.109.0/node/internal_binding/fs.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