September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool chmod(string file, int mode)
Changes the access permissions of a file.
Returns:
TRUE on success; FALSE on error
Description:
chmod() changes the permissions of the specified file. The file mode should be specified in octal format and hence should have a leading 0. For more information on octal notation of file permissions, see the UNIX man page on chmod.
Note:
If safe mode is enabled, chmod() can only change the permissions of files that are owned by the user running the command. In most cases, this is the user that the web server runs as.
Example:
$file = "test_file";
if (! chmod($file, 0644)) {
echo ("Unable to change file permissions");
}
|
Read now
Unlock full access