Query: umask
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
UMASK(3) 1 UMASK(3) umask - Changes the current umaskSYNOPSISint umask ([int $mask])DESCRIPTIONumask(3) sets PHP's umask to $mask & 0777 and returns the old umask. When PHP is being used as a server module, the umask is restored when each request is finished.PARAMETERSo $mask - The new umask.RETURN VALUESumask(3) without arguments simply returns the current umask otherwise the old umask is returned.EXAMPLESExample #1 umask(3) example <?php $old = umask(0); chmod("/path/some_dir/some_file.txt", 0755); umask($old); // Checking if ($old != umask()) { die('An error occurred while changing back the umask'); } ?>NOTESNote Avoid using this function in multithreaded webservers. It is better to change the file permissions with chmod(3) after creating the file. Using umask(3) can lead to unexpected behavior of concurrently running scripts and the webserver itself because they all use the same umask. PHP Documentation Group UMASK(3)
Related Man Pages |
---|
umask(2) - opensolaris |
pam_umask(8) - centos |
pam_umask(8) - debian |
umask(2) - hpux |
umask(3) - php |
Similar Topics in the Unix Linux Community |
---|
Unix File Permissions |
Changing default permissions -without "umask"-... |
Unmask |
Changing system-wide for umask |
Umask permission |