--- name: umask status: documented runtime: pp source: src/runtime/pp/filemod.rs --- ```{index} single: umask; Perl built-in (pp runtime) ``` # umask ## Synopsis ```perl my $old_mask = umask(0022); # Set new mask, return old my $current = umask(); # Query current mask ``` ## Description Gets or sets the process file-creation permission mask. With an argument, sets the umask to the given value and returns the previous mask. Without an argument (or with undef), queries the current mask by temporarily setting it to 0 and restoring it, then returns the value. The umask affects the default permissions of newly created files and directories. The actual permissions are `requested & ~umask`. Returns the previous umask as an integer (typically displayed in octal). ## See also chmod, mkdir, open