I am working on a C program where I need to get the last modified time of the file. What the program does is a function loops through each file within a directory and when a
This worked fine for me:
#include #include #include #include #include void getFileCreationTime(char *path) { struct stat attr; stat(path, &attr); printf("Last modified time: %s", ctime(&attr.st_mtime)); }