Skip to content
class method

File.umask

(?::int umask) -> ::Integer
File.umask() → integer
File.umask(integer) → integer

Returns the current umask value for this process. If the optional argument is given, set the umask to that value and return the previous value. Umask values are subtracted from the default permissions, so a umask of 0222 would make a file read-only for everyone.

Example
File.umask(0006)   #=> 18
File.umask         #=> 6
See also .truncate .unlink .symlink? .utime also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0