Introduction
  CGI and SSI
  <pike> tag
  Pike script
  Modules
  Parser modules
  Location modules
    find_dir()
    find_file()
    query_location()
    real_file()
    stat_file()
  Other module types
  Request information object
  Responses
  Library methods
 
stat_file()

void|array(int) stat_file(string path, object id)

The stat_file() emulates Pike's file_stat() method, returning information about a file or directory. path is the path to the file or directory in the modules name space. id is the request information object.

stat_file() is most commonly used by directory type modules to provide informative directory listings, or by the ftp protocol module to create directory listings.

The return value it is expected to be an array of integers in the following format:

({ mode, size, atime, mtime, ctime, uid, gid })
mode
is an integer containing the unix file permissions of the file. It can be ignored.

size
is an integer containing the size of the file, or a special value in case the object is not actually a file. Minus two means that it is a director, minus three that it is a symbolic link and minus four that it is a special device. This value must be given.

atime
is an integer containing the last time the file was accessed, as seconds from 1970. It can be ignored.

mtime
is an integer containing the last time the file was modified, as seconds from 1970. It will be used to handle Last-Modified-Since requests and should be supplied if possible.

ctime
is an integer containing the time the file was created, as seconds from 1970. It can be ignored.

uid
is an integer containing the user id of the this file. It will be correlated with the information from the current authentification type module, and used by the CGI executable support module to start CGI scripts as the correct user. It is only necessary for location modules that provide access to a real file system and that implement the real_file() method.

gid
is an integer containing the group id of the file. It is needed when uid is needed.