I have a problem with checking the modification date. fprintf prints in the console for every file in the folder the same number equal zero.
while (1) {
source = opendir(argv[1]);
while ((file = readdir(source)) != NULL) {
if (file->d_type != DT_REG)
continue;
stat(file->d_name, &file_details);
fprintf(stderr, "Name: %s, Last modify: %ld \n", file->d_name, file_details.st_mtime);
}
closedir(source);
sleep(5);
}