mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
docs: fix ftruncateSync example (#10393)
This commit is contained in:
parent
299518d935
commit
4fa0e9c652
1 changed files with 3 additions and 2 deletions
5
cli/dts/lib.deno.ns.d.ts
vendored
5
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -2357,9 +2357,10 @@ declare namespace Deno {
|
|||
* 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"));
|
||||
* const file = Deno.openSync("my_file.txt", { read: true, write: true, create: true });
|
||||
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello World"));
|
||||
* Deno.ftruncateSync(file.rid, 7);
|
||||
* Deno.seekSync(file.rid, 0, Deno.SeekMode.Start);
|
||||
* const data = new Uint8Array(32);
|
||||
* Deno.readSync(file.rid, data);
|
||||
* console.log(new TextDecoder().decode(data)); // Hello W
|
||||
|
|
Loading…
Reference in a new issue