BREAKING(fs): remove Deno.fsync[Sync]() (#25448)

Towards #22079

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
Asher Gomez 2024-09-10 08:39:56 +10:00 committed by GitHub
parent 064a73f7a0
commit a445ebd74f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 9 additions and 96 deletions

View file

@ -1785,44 +1785,6 @@ declare namespace Deno {
*/
export function createSync(path: string | URL): FsFile;
/**
* Flushes any pending data and metadata operations of the given file stream
* to disk.
*
* ```ts
* const file = await Deno.open(
* "my_file.txt",
* { read: true, write: true, create: true },
* );
* await file.write(new TextEncoder().encode("Hello World"));
* await file.truncate(1);
* await Deno.fsync(file.rid);
* console.log(await Deno.readTextFile("my_file.txt")); // H
* ```
*
* @category File System
*/
export function fsync(rid: number): Promise<void>;
/**
* Synchronously flushes any pending data and metadata operations of the given
* file stream to disk.
*
* ```ts
* const file = Deno.openSync(
* "my_file.txt",
* { read: true, write: true, create: true },
* );
* file.writeSync(new TextEncoder().encode("Hello World"));
* file.truncateSync(1);
* Deno.fsyncSync(file.rid);
* console.log(Deno.readTextFileSync("my_file.txt")); // H
* ```
*
* @category File System
*/
export function fsyncSync(rid: number): void;
/** The Deno abstraction for reading and writing files.
*
* This is the most straight forward way of handling files within Deno and is