Help for this page
umask(000); mkdir($dir, 0777); # or creating a file mode 0666, etc ... ... chmod($dir, $mode);