MCPcopy Create free account
hub / github.com/denoland/std / truncate

Method truncate

fs/unstable_types.ts:479–479  ·  view source on GitHub ↗

* Truncates (or extends) the file to reach the specified `len`. If `len` is * not specified, then the entire file contents are truncated. * * @example Truncate the entire file * ```ts ignore * import { open } from "@std/fs/unstable-open"; * using file = await open("my_file.txt", {

(len?: number)

Source from the content-addressed store, hash-verified

477 * ```
478 */
479 truncate(len?: number): Promise<void>;
480 /**
481 * Synchronously truncates (or extends) the file to reach the specified `len`.
482 * If `len` is not specified, then the entire file contents are truncated.

Callers 4

buffer_test.tsFile · 0.65
buffer_test.tsFile · 0.65
truncateFunction · 0.65

Implementers 1

NodeFsFilefs/_node_fs_file.ts

Calls

no outgoing calls

Tested by

no test coverage detected