Specifications
?>
</body>
</html>
The results of one sample run of Listing 16.4 are shown in Figure 16.4.
Interacting with the File System and the Server
C
HAPTER 16
16
INTERACTING WITH
THE
F
ILE SYSTEM
AND THE
SERVER
363
LISTING 16.4 Continued
FIGURE 16.4
The File Details view shows file system information about a file. Note that permissions are shown in an octal format.
Let’s talk about what each of the functions used in Listing 16.4 does.
As mentioned previously, the basename() function gets the name of the file without the direc-
tory. (You can also use the dirname() function to get the directory name without the filename.)
The fileatime() and filemtime() functions return the time stamp of the time the file was
last accessed and last modified, respectively. We’ve reformatted the time stamp using the
date() function to make it more human-readable. These functions will return the same value
on some operating systems (as in the example) depending on what information the system
stores.
The fileowner() and filegroup() functions return the user ID (uid) and group ID (gid) of
the file. These can be converted to names using the functions posix_getpwuid() and
posix_getgrgid(), respectively, which makes them a bit easier to read. These functions take
the uid or gid as a parameter and return an associative array of information about the user or
group, including the name of the user or group, as we have used in this script.
21 7842 CH16 3/6/01 3:40 PM Page 363










