summaryrefslogtreecommitdiff
path: root/os.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-28 14:39:02 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-28 14:39:02 -0400
commit46117017c4b2b7024da27150e0eda1408a819750 (patch)
tree5c40dea7d3651ecfb77365d74894c578f0f9781d /os.ts
parentbce0ecbdb8af0d6f5c089c7f2139b58ff2f60624 (diff)
Add writeFileSync
Diffstat (limited to 'os.ts')
-rw-r--r--os.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/os.ts b/os.ts
index 8628edd2a..18ccb5bb5 100644
--- a/os.ts
+++ b/os.ts
@@ -48,3 +48,16 @@ export function readFileSync(filename: string): Uint8Array {
});
return res.readFileSyncData;
}
+
+export function writeFileSync(
+ filename: string,
+ data: Uint8Array,
+ perm: number
+): void {
+ sendMsg("os", {
+ command: pb.Msg.Command.WRITE_FILE_SYNC,
+ writeFileSyncFilename: filename,
+ writeFileSyncData: data,
+ writeFileSyncPerm: perm
+ });
+}