FILEOWNER(3) 1 FILEOWNER(3)
fileowner - Gets file owner
SYNOPSIS
int fileowner (string $filename)
DESCRIPTION
Gets the file owner.
PARAMETERS
o $filename
- Path to the file.
RETURN VALUES
Returns the user ID of the owner of the file, or FALSE on failure. The user ID is returned in numerical format, use posix_getpwuid(3) to
resolve it to a username.
EXAMPLES
Example #1
Finding the owner of a file
<?php
$filename = 'index.php';
print_r(posix_getpwuid(fileowner($filename)));
?>
ERRORS
/EXCEPTIONS
Upon failure, an E_WARNING is emitted.
NOTES
Note
The results of this function are cached. See clearstatcache(3) for more details.
Tip
As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine
which wrappers support stat(3) family of functionality.
SEE ALSO
filegroup(3), stat(3), posix_getpwuid(3).
PHP Documentation Group FILEOWNER(3)