A site for solving at least some of your technical problems...
A site for solving at least some of your technical problems...
A little while ago I noticed that I couldn't find documentation on how to get the modification time of a file in micro-seconds. The notorious stat() call returns st_mtime defined as a time_t in the documentation.
Well... The fact is that the structure is really composed of a timeval structure and not a time_t (that applies to all 3 time values: modification, last access, and last status change.) So in fact you can use the name of the field without the last letter and a sub-timeval field as in:
struct stat s; seconds = s.st_mtim.tv_sec; // == s.st_mtime microseconds = s.st_mtim.tv_usec;
Strange that the documentation does not even mention the fact in the Linux documentation...