#include #include #include #include void Stat(const char *path, struct stat *buf) { if (stat(path,buf) != 0) buf->st_mtime = (time_t)0; /* non-existant file has mod time */ /* in distant past */ } int main(int argc, char *argv[]) { struct stat s; struct stat t; Stat(argv[1], &s); Stat(argv[2], &t); return ((s.st_mtime > t.st_mtime) ? EXIT_SUCCESS : EXIT_FAILURE); }