note 32456 added to function.posix-getpwuid
| From: | rolf dot winterscheidt at rowitech dot de | Date: | Wed, 28 May 2003 09:34:24 +0000 |
| Subject: | note 32456 added to function.posix-getpwuid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49159@lists.php.net to get a copy of this message | ||
To get the name of the owner of a file you can use something like this:
<?php
$startscript="/var/log/hello.log";
$fileowneruid=fileowner($startscript);
$fileownerarray=posix_getpwuid($fileownerid);
$fileowner=$fileownerarray['name'];
echo "Owner is $fileowner";
?>
(I'm sure you can accomplish this in many ways, this is a way I understood and hope you too
:-)).
Rolf
----
Manual Page -- http://www.php.net/manual/en/function.posix-getpwuid.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32456
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32456&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32456&report=yes