The following function is chown related information Oh, well, crap don't say come to see it.
The following function is chown related information Oh, well, crap don't say come to see it.
Chown
(PHP 4, PHP 5)
chown-Changing the file owner
Describe
Boolean chown (string $ file name, mixed $ user)
Attempt to change the file owner profile to the user's user. Only supervisor can change people's files.
Parameters
Filename
The file path.
User
User name or number.
return value
Returns TRUE or FALSE for successful failure.
Instance
File name and username to use
$file _name= "foo.php";
$path = "/home/sites/php.net/public_html/sandbox". $file _name;
$user _name = "root";
Set the user
Chown ($path, $user _name);
Check the result
$stat = stat ($path);
Print_r (Posix_getpwuid ($stat [' uid ']);
?>
The above example would output something similar to:
Array (7) {
["Name"]=>
String ("Php.net")
["passwd"]=>
String (1) "X"
["UID"]=>
Int (148864)
["GID"]=>
Int (148910)
["Gecos"]=>
String ("Php.net")
["dir"]=>
String ("/home/sites/php.net")
["Shell"]=>
String ("/sbin/nologin")
}
Webmaster Recommendation:
PHP Chinese Online manual
http://www.bkjia.com/PHPjc/445487.html www.bkjia.com true http://www.bkjia.com/PHPjc/445487.html techarticle The following function is chown related information Oh, well, crap don't say come to see it. The following function is chown related information Oh, well, crap don't say come to see it. Chown (PHP 4, ...