umask.d.elv 1.0 KB

12345678910111213141516171819
  1. #elvdoc:var umask
  2. #
  3. # The file mode creation mask. Its value is a string in Elvish octal
  4. # representation; e.g. 0o027. This makes it possible to use it in any context
  5. # that expects a `$number`.
  6. #
  7. # When assigning a new value a string is implicitly treated as an
  8. # octal number. If that fails the usual rules for interpreting
  9. # [numbers](./language.html#number) are used. The following are equivalent:
  10. # `set unix:umask = 027` and `set unix:umask = 0o27`. You can also assign to it
  11. # a `float64` data type that has no fractional component. The assigned value
  12. # must be within the range [0 ... 0o777], otherwise the assignment will throw
  13. # an exception.
  14. #
  15. # You can do a temporary assignment to affect a single command; e.g. `umask=077
  16. # touch a_file`. After the command completes the old umask will be restored.
  17. # **Warning**: Since the umask applies to the entire process, not individual
  18. # threads, changing it temporarily in this manner is dangerous if you are doing
  19. # anything in parallel, such as via the [`peach`](builtin.html#peach) command.