برگزیده های پرشین تولز

umask

sasan_66

کاربر تازه وارد
تاریخ عضویت
18 جولای 2006
نوشته‌ها
450
لایک‌ها
0
ممكنه يه خورده در مورد تابع umask توضيح بدين؟
 

kasra515

کاربر تازه وارد
تاریخ عضویت
25 نوامبر 2005
نوشته‌ها
46
لایک‌ها
0
محل سکونت
IRAN !!!
این توضیح خود سایت PHP :
umask
(PHP 3, PHP 4, PHP 5)

umask -- Changes the current umask
Description
int umask ( [int mask] )


umask() 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.

umask() without arguments simply returns the current umask.

????: Avoid using this function in multithreaded webservers. It is better to change the file permissions with chmod() after creating the file. Using umask() can lead to unexpected behavior of concurrently running scripts and the webserver itself because they all use the same umask.

????? 1. umask() example



PHP:
<?php
$old = umask(0);
chmod("/path/some_dir/some_file.txt", 0755);
umask($old);

// Checking
if ($old != umask()) {
    die('An error occured while changing back the umask');
}
?>
 

sasan_66

کاربر تازه وارد
تاریخ عضویت
18 جولای 2006
نوشته‌ها
450
لایک‌ها
0
خوب اينو ديدم ولي چيزه زيادي ازش دستگيرم نشد:(
 
بالا