Programming Perl

Programming PerlSearch this book
Previous: 3.2.178 ucfirstChapter 3
Functions
Next: 3.2.180 undef
 

3.2.179 umask

umask EXPR
umask

This function sets the umask for the process and returns the old one. (The umask tells UNIX which permission bits to disallow when creating a file.) If EXPR is omitted, the function merely returns the current umask. For example, to ensure that the "other" bits are turned on, and the "user" bits are turned off, try something like:

umask((umask() & 077) | 7);


Previous: 3.2.178 ucfirstProgramming PerlNext: 3.2.180 undef
3.2.178 ucfirstBook Index3.2.180 undef