summaryrefslogtreecommitdiff
path: root/cli/js/ops/fs/umask.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/ops/fs/umask.ts')
-rw-r--r--cli/js/ops/fs/umask.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/js/ops/fs/umask.ts b/cli/js/ops/fs/umask.ts
new file mode 100644
index 000000000..ee56fecb5
--- /dev/null
+++ b/cli/js/ops/fs/umask.ts
@@ -0,0 +1,12 @@
+// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
+import { sendSync } from "../dispatch_json.ts";
+
+/**
+ * **UNSTABLE**: maybe needs `allow-env` permissions.
+ *
+ * If `mask` is provided, sets the process umask. Always returns what the umask
+ * was before the call.
+ */
+export function umask(mask?: number): number {
+ return sendSync("op_umask", { mask });
+}