Version 5 of file stat

Updated 2005-12-15 17:53:39

file stat name varName

Invokes the stat kernel call on name, and uses the variable given by varName to hold information returned from the kernel call. VarName is treated as an array variable, and the following elements of that variable are set: atime, ctime, dev, gid, ino, mode, mtime, nlink, size, type, uid. Each element except type is a decimal string with the value of the corresponding field from the stat return structure; see the manual entry for stat for details on the meanings of the values. The type element gives the type of the file in the same form returned by the command file type. This command returns an empty string.


A combination of glob and file stat can be used, for instance, to implement ls -l in Tcl.


See also:


Tcl syntax help - Category Command - Category Introspection - Category File