diff options
Diffstat (limited to 'cli/js/ops/io.ts')
-rw-r--r-- | cli/js/ops/io.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/cli/js/ops/io.ts b/cli/js/ops/io.ts index 9f53707b7..38963e360 100644 --- a/cli/js/ops/io.ts +++ b/cli/js/ops/io.ts @@ -10,15 +10,6 @@ import { OPS_CACHE } from "../runtime.ts"; let OP_READ = -1; let OP_WRITE = -1; -/** Synchronously read from a file ID into an array buffer. - * - * Returns `number | EOF` for the operation. - * - * const file = Deno.openSync("/foo/bar.txt"); - * const buf = new Uint8Array(100); - * const nread = Deno.readSync(file.rid, buf); - * const text = new TextDecoder().decode(buf); - */ export function readSync(rid: number, p: Uint8Array): number | EOF { if (p.length == 0) { return 0; @@ -36,15 +27,6 @@ export function readSync(rid: number, p: Uint8Array): number | EOF { } } -/** Read from a resource ID into an array buffer. - * - * Resolves to the `number | EOF` for the operation. - * - * const file = await Deno.open("/foo/bar.txt"); - * const buf = new Uint8Array(100); - * const nread = await Deno.read(file.rid, buf); - * const text = new TextDecoder().decode(buf); - */ export async function read(rid: number, p: Uint8Array): Promise<number | EOF> { if (p.length == 0) { return 0; @@ -62,15 +44,6 @@ export async function read(rid: number, p: Uint8Array): Promise<number | EOF> { } } -/** Synchronously write to the resource ID the contents of the array buffer. - * - * Resolves to the number of bytes written. - * - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world\n"); - * const file = Deno.openSync("/foo/bar.txt", {create: true, write: true}); - * Deno.writeSync(file.rid, data); - */ export function writeSync(rid: number, p: Uint8Array): number { if (OP_WRITE < 0) { OP_WRITE = OPS_CACHE["op_write"]; @@ -83,15 +56,6 @@ export function writeSync(rid: number, p: Uint8Array): number { } } -/** Write to the resource ID the contents of the array buffer. - * - * Resolves to the number of bytes written. - * - * const encoder = new TextEncoder(); - * const data = encoder.encode("Hello world\n"); - * const file = await Deno.open("/foo/bar.txt", {create: true, write: true}); - * await Deno.write(file.rid, data); - */ export async function write(rid: number, p: Uint8Array): Promise<number> { if (OP_WRITE < 0) { OP_WRITE = OPS_CACHE["op_write"]; |