#include <sys/types.h> #include <sys/stat.h> #include <string> using namespace std;
int main() { string filename = "./file.txt"; struct stat result; if(stat(filename.c_str(), &result) == 0) { auto modify_time = result.st_mtime; printf("Last file modification: %s", ctime(&modify_time)); } }
|