FILEOWNER(3) 1 FILEOWNER(3)fileowner - Gets file ownerSYNOPSIS
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)
Check Out this Related Man Page
FILEMTIME(3) 1 FILEMTIME(3)filemtime - Gets file modification timeSYNOPSIS
int filemtime (string $filename)
DESCRIPTION
This function returns the time when the data blocks of a file were being written to, that is, the time when the content of the file was
changed.
PARAMETERS
o $filename
- Path to the file.
RETURN VALUES
Returns the time the file was last modified, or FALSE on failure. The time is returned as a Unix timestamp, which is suitable for the
date(3) function.
EXAMPLES
Example #1
filemtime(3) example
<?php
// outputs e.g. somefile.txt was last modified: December 29 2002 22:16:23.
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
?>
ERRORS /EXCEPTIONS
Upon failure, an E_WARNING is emitted.
NOTES
Note
Note that time resolution may differ from one file system to another.
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 filectime(3), stat(3), touch(3), getlastmod(3).
PHP Documentation Group FILEMTIME(3)
Can someone pleas tell me if there is something funny when it comes to unix permissions and PHP. When php creates a file in unix the owner is nobody...does this raise any issues, and if it does could someone please tell me a web site where I could read more about this. Thanks alot.
John (2 Replies)
I have installed TCP wrappers , Good package ...
I have a problem with the hosts_options part ...
I am not able to use the twist command .. It just dosent respond
I have compiled wrappers 7.6 for Solaris 8 with ipv6 support ...
Everything works fine except the twist doesnt work
I have... (1 Reply)
hi ,
i want to know how to do this....
i have a file in which an owner name and corresponding filename are written as shown below...
owner filename
abc /home/accounts/results/new.txt
abc /home/accounts/results/new1.txt
abc ... (1 Reply)