C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
_umask
 Summary Example                         Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The _umask function sets the file-permission mask of the current
     process to the mode specified by <pmode>.
 
     The file-permission mask is used to modify the permission setting
     of new files created by _creat, _open, or _sopen. If a bit in the
     mask is 1, the corresponding bit in the file's requested
     permission value is set to 0 (disallowed). If a bit in the mask is
     0, the corresponding bit is left unchanged. The permission setting
     for a new file is not set until the file is closed for the first
     time.
 
     The argument <pmode> is a constant expression containing one or
     both of the manifest constants _S_IWRITE and _S_IREAD (defined in
     SYS\STAT.H). When both constants are given, they are combined
     with the bitwise-OR operator (|).
 
     For example, if the write bit is set in the mask, any new files
     are read-only.
 
     Note that with DOS, all files are readable──it is not possible to
     give write-only permission. Therefore, setting the read bit with
     _umask has no effect on the file's modes.
 
     Return Value
 
     The _umask function returns the previous value of <pmode>. There
     is no error return.
                                    -♦-