Name

STAT — Evaluates filesystem attributes

Synopsis

STAT(flag,filename)

Does a check on the specified file.

flag may be one of the following options:

e

Returns 1 if the file exists; 0 otherwise

s

Returns the size of the file, in bytes

f

Returns 1 if the path referenced is a regular file (and not a directory, symlink, socket, or device) or 0 otherwise

d

Returns 1 if the path referenced is a directory (and not a regular file, symlink, socket, or device) or 0 otherwise

M

Returns the epoch time when the file contents were last modified

C

Returns the epoch time when the file inode was last modified

m

Returns the permissions mode of the file (as an octal number)

Get Asterisk: The Future of Telephony, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.