umask

import { umask } from "jsr:@ende/fs/unstable-umask";

function ยท experimental

function umask(mask?: number): number

Retrieve the process umask. If mask is provided, sets the process umask. This call always returns what the umask was before the call.

mask?: number

The new process mask

Returns

The previous mask

Example: Usage

import { assert } from "@ende/assert";
import { umask } from "@ende/fs/unstable-umask";

const prevUmaskValue = Ende.umask(0o077);
const currentUmaskValue = Ende.umask();
assert(prevUmaskValue !== currentUmaskValue)

This API is under consideration to determine if permissions are required to call it.

Note: This API is not implemented on Windows

Source