stat - get file status
These functions return information about the specified file. You do not need any access rights to the file to get this information but you need search rights to all directories named in the path leading to the file.
stat stats the file pointed to by file_name and fills in buf.
lstat is identical to stat, except in the case of a ?symbolic_link, where the link itself is stat-ed, not the file that it refers to.
fstat is identical to stat, only the open file pointed to by filedes (as returned by open(2) ) is stat-ed in place of file_name.
They all return a stat structure, which contains some fields.