summaryrefslogtreecommitdiff
path: root/cli/js/ops/fs/sync.ts
blob: 7f208b8bdd279b08076662a0fd628375820442af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.

import { sendSync, sendAsync } from "../dispatch_json.ts";

export function fdatasyncSync(rid: number): void {
  sendSync("op_fdatasync", { rid });
}

export async function fdatasync(rid: number): Promise<void> {
  await sendAsync("op_fdatasync", { rid });
}

export function fsyncSync(rid: number): void {
  sendSync("op_fsync", { rid });
}

export async function fsync(rid: number): Promise<void> {
  await sendAsync("op_fsync", { rid });
}