I am trying to write a loop that gets the modified dates from a directory of files. My problem is that it seems the call to stat(filename, attrib) is not replacing the information in the last call. It seems stuck on the second directory "." am i missing some deconstructor call or memory free? Note: the files in the directory were all created and modified at different times yesterday and today.
while ((dirp = readdir(dp)) != NULL)
strftime(date, 20, "%y.%m.%d.%H.%M.%S", localtime(&attrib.st_mtime)));
} the output: