chmod

(PHP 3, PHP 4 )

chmod -- Changes file mode

Description

int chmod ( string filename, int mode)

Attempts to change the mode of the file specified by filename to that given in mode.

Note that mode is not automatically assumed to be an octal value, so strings (such as "g+w") will not work properly. To ensure the expected operation, you need to prefix mode with a zero (0):

chmod ("/somedir/somefile", 755);   // decimal; probably incorrect   
chmod ("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect       
chmod ("/somedir/somefile", 0755);  // octal; correct value of mode

מחזיר TRUE במקרה של הצלחה או FALSE במקרה של כישלון.

See also chown() and chgrp().

הערה: פונקציה זו לא מיושמת תחת פלטפורמות וינדוס.