Reorganized April 2024
xcall MIAMEX, MX_GETUMSK, umask
xcall MIAMEX, MX_SETUMSK, umask
(Unix only)
MX_GETUMSK (MIAMEX 69) retrieves the current UMASK setting. umask (Num) will return with the current value of the UMASK, treating it as if it were a decimal number. For example, if the UMASK is 111 (which is actually an octal pattern), the returned umask value will be 111 (decimal).
MX_SETUMSK (MIAMEX 70) establishes a new UMASK setting.
umask (Num) should be set to the 3-digit decimal number, which if interpreted as octal, represents the desired UMASK setting. For example, to set the UMASK to 117, simply set umask=117. (In other words, you can ignore the fact that the UMASK is actually an octal representation of a bit pattern.)
A-Shell’s default UMASK is 111. If you set umask=000, A-Shell will instead use the mask set by the shell. Otherwise it will use the specified mask.
Note that the bits in the umask clear the corresponding bits in the file creation mask, which starts at 666 (rw-rw-rw-). So setting UMASK to 111 will result in no change to the rw-rw-rw- mask. But setting UMASK to 137 would result in rw-r---- (rw by the file owner, read only by members of the group, otherwise no access).
You may also set the UMASK in miame.ini, using UMASK=xxx.