I think I'll do it the hard way:
function whoami() // get numeric owner of files
{ $temp = tmpfile(); // make temp file
if (is_bool($temp)) // failure
return (0);
$fstat = fstat($temp); // get file stats
if (is_bool($fstat)) // failure
return (0);
$x = $fstat[4]; // file owner
$y =...
My PHP script generates files. It can be run by Apache, cron or userx (command line). Thus the files get different owners. How does the script find out (before the file is generated) who the owner will be?
TIA,
Keith.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.