Pumask

Section: Oct. 1, 1991 (2)
Updated: MiNT Programmer's Manual
Index Return to Main Contents
 

NAME

Pumask - set file and directory creation mask  

SYNOPSIS

WORD Pumask( WORD mode );
 

DESCRIPTION

Pumask changes the file and directory creation mask of the current process to the unsigned 16 bit quantity specified in mode. The old value of the creation mask is returned. Child processes inherit the new value for the mask.

When a new file is created with Fcreate or a new directory created with Dcreate the initial access permissions (see Fchmod for a description of these) for the newly created file or directory are normally set so that all permissions are granted (except that execute permission is not normally granted for files). The creation mask set by Pumask determines which permissions are not to be granted by default. Thus, files created after a Pumask(S_IWOTH|S_IWGRP|S_IXOTH) call will be readable by anyone, but writable only by the owner; moreover, directories created after this call would be searchable by the owner and members of the same group, but not by anyone else.  

SEE ALSO

Dcreate(2), Fchmod(2), Fcreate(2)  

BUGS

Pumask doesn't affect explicit Fchmod calls, as some might expect.


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
BUGS

This document was created by man2html, using the manual pages.
Time: 23:26:12 GMT, January 03, 2023