PHP Wysardry
PHP Manual

PHP documentation.



Home / PHP / Manual / ...



PHP Manual
Prev Next

chmod

(PHP 3 <= 3.0.18, PHP 4 >= 4.0.0)

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

Returns TRUE on success and FALSE otherwise.

See also chown() and chgrp().

Note: This function is not implemented on Windows platforms.


Prev Manual Home Next
chgrp Up chown
Site Menu

Amazon.ca
Amazon.com
Amazon.co.uk



Most recently updated on 11 May, 2003

Home / PHP / Manual / ...



Please feel free to contact us with any comments or suggestions
PHP Manual
PHP Wysardry

This site is hosted by Spaceports