.Dd March 22, 2013 .Os SQLite\ UDF .Dt STAT \&3s "SQLite User-defined Functions" .Sh NAME .Nm stat .Nd Extract inode metadata for a filename .Sh LIBRARY SQLite User-defined function Library (readdir.so) .Sh SYNOPSIS select .Pf stat( Pa filename , Ar stat_field Ns ); .Sh DESCRIPTION The .Nm function executes a call to .Xr stat 2 for .Pa filename , returning .Ar stat_field from .Fa struct stat as defined in .In sys/stat.h . The supported values for .Ar stat_field are: .sp .Bl -tag -width birthtimensec -compact .It mode the file's mode (protection and type) .It nlink number of hard links to the file .It uid user-id of owner .It gid group-id of owner .It rdev device type, for device special file .It atime time of last access .It atimensec nsec of last access .It mtime time of last data modification .It mtimensec nsec of last data modification .It ctime time of last file status change .It ctimensec nsec of last file status change .It size file size, in bytes .It blocks blocks allocated for file .It blksize optimal file sys I/O ops blocksize .It flags user defined flags for file .It gen file generation number .It birthtime time of inode creation .It birthtimensec nsec of inode creation .El .Sh EXAMPLES .Bd -literal sqlite> select stat('/home', 'mode') as mode; mode ---------- 16877 .Ed .Sh IMPLEMENTATION NOTES To use .Nm in the SQLite shell .Ic sqlite3 , add the following to your .Pa ${HOME}/.sqliterc file: .Bd -literal \&.load /usr/local/lib/sqlite3/readdir.so .Ed .Sh SEE ALSO .Xr readdir 3s .Xr strmode 3s .Pp The above SQLite user-defined functions are intended for use with .Nm . .Sh AUTHORS .Nm was contributed by James K. Lowden .\" .Sh BUGS