Add Deno.umask (#4290)

This commit is contained in:
dubiousjim 2020-03-10 15:11:27 -04:00 committed by GitHub
parent 6443e4aed1
commit 8078d976d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 80 additions and 0 deletions

12
cli/js/ops/fs/umask.ts Normal file
View file

@ -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 });
}