if(chmod("data.txt", 0666))
{
print("mode change successful");
}
else
{
print("mode change unsuccessful");
}
?>
boolean chown(string filename, string user)
The owner of the named file is changed by the chown function. If successful, TRUE is
returned. Otherwise the function returns FALSE. Under Windows this function does
nothing and always returns TRUE. This function is similar to chgrp and chmod. If you
need to know the current owner of a file, use the fileowner function.
<?
/*
* change owner to leon
/
if(chown("data.txt","leon"))
{
print("owner changed");
}
else
{
print("couldn't change owner");
}
?>
closedir(integer directory_handle)
The closedir function closes a directory after it has been opened with the opendir
function. PHP will close a directory connection for you when the script ends, so use of
this function is not strictly necessary.
Figure 8-1. closedir.