Skip to main content
Latest
function Deno.openSync
import { Deno } from "https://deno.land/x/adka_server@0.1.5/deno.d.ts";
const { openSync } = Deno;

Synchronously open a file and return an instance of Deno.File. The file does not need to previously exist if using the create or createNew open options. It is the callers responsibility to close the file when finished with it.

const file = Deno.openSync("/foo/bar.txt", { read: true, write: true });
// Do work with file
Deno.close(file.rid);

Requires allow-read and/or allow-write permissions depending on options.

Parameters

path: string
optional
options: OpenOptions