Darwin Help

Back to Index

FileStat

Class FileStat - the unix file status structure

Calling Sequence  FileStat(path)
Parameters
NameTypeDescription

path stringa filename or a path
st_dev posintdevice
st_ino posintinode
st_mode posintprotection
st_nlink posintnumber of hard links
st_uid integeruser ID of owner
st_gid integergroup ID of owner
st_rdev integerdevice type (if inode device)
st_size integertotal size, in bytes
st_blksize posintblocksize for filesystem I/O
st_blocks integernumber of blocks allocated
st_atime posinttime of last access
st_mtime posinttime of last modification
st_ctime posinttime of last change
Return Type  FileStat
Synopsis This class stores the unix stat structure, see "man 2 stat" in any unix system for details. When called with a single argument, it constructs the entire structure. The unix names have been retained for the fields. This operation is very efficient, it only requires reading the directory and completes without the execution of any system command. Hence it is the recommended way of finding any information about a file. When the file does not exist, an empty data structure is returned.
Examples
> FileStat(libname)[st_size];
81920
> FileStat('/dev/null')[st_mtime];
1270571999
> FileStat(non_existing_file);
FileStat()
See also inputoutput,   OpenAppending,   OpenReading,   OpenWriting,   ReadData,   ReadLine,   ReadRawFile,   ReadRawLine,   SearchDelim,   SplitLines