diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-04-11 20:05:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-11 14:05:22 +0200 |
commit | f5a9474952f459a5095e0aae68e0984fdd84b210 (patch) | |
tree | 314c1e9e9c5d86e0360b5e21d308d870d009723d /cli/dts/lib.deno.unstable.d.ts | |
parent | c0b6e09172f242e98a5bc82bd6f5dc20f705c8a2 (diff) |
feat: stabilize Deno.ftruncate and Deno.ftruncateSync (#10126)
This stabilizes Deno.ftruncate and Deno.ftruncateSync.
This is a well known system call and the interface is
not going to change. Implicitly requires write permissions
as the file has to be opened with write to be truncated.
Diffstat (limited to 'cli/dts/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 9113d38c7..3fbf3d94d 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1042,47 +1042,6 @@ declare namespace Deno { */ export function hostname(): string; - /** **UNSTABLE**: new API, yet to be vetted. - * Synchronously truncates or extends the specified file stream, to reach the - * specified `len`. If `len` is not specified then the entire file contents - * are truncated. - * - * ```ts - * // truncate the entire file - * const file = Deno.open("my_file.txt", { read: true, write: true, truncate: true, create: true }); - * Deno.ftruncateSync(file.rid); - * - * // truncate part of the file - * const file = Deno.open("my_file.txt", { read: true, write: true, create: true }); - * Deno.write(file.rid, new TextEncoder().encode("Hello World")); - * Deno.ftruncateSync(file.rid, 7); - * const data = new Uint8Array(32); - * Deno.readSync(file.rid, data); - * console.log(new TextDecoder().decode(data)); // Hello W - * ``` - */ - export function ftruncateSync(rid: number, len?: number): void; - - /** **UNSTABLE**: new API, yet to be vetted. - * Truncates or extends the specified file stream, to reach the specified `len`. If - * `len` is not specified then the entire file contents are truncated. - * - * ```ts - * // truncate the entire file - * const file = Deno.open("my_file.txt", { read: true, write: true, create: true }); - * await Deno.ftruncate(file.rid); - * - * // truncate part of the file - * const file = Deno.open("my_file.txt", { read: true, write: true, create: true }); - * await Deno.write(file.rid, new TextEncoder().encode("Hello World")); - * await Deno.ftruncate(file.rid, 7); - * const data = new Uint8Array(32); - * await Deno.read(file.rid, data); - * console.log(new TextDecoder().decode(data)); // Hello W - * ``` - */ - export function ftruncate(rid: number, len?: number): Promise<void>; - /** **UNSTABLE**: New API, yet to be vetted. * Synchronously returns a `Deno.FileInfo` for the given file stream. * |