mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
Add Deno.umask (#4290)
This commit is contained in:
parent
6443e4aed1
commit
8078d976d2
7 changed files with 80 additions and 0 deletions
12
cli/js/ops/fs/umask.ts
Normal file
12
cli/js/ops/fs/umask.ts
Normal 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 });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue