I am reasonably new to C++ and I am having problems with reading a file timestamp. My objective is to just look at the files timestamp, if it is the newest in the folder, want to to move that file to another file. I dont have any need for modifying the timestamp at all. I need to implement this in C++ as it is concerning a windows mobile based device. If any one can help it would be much appreciated, it is pretty urgent as this is for work. thanks
Use the following code. Code: CFileStatus fs; if (CFile::GetStatus(szFile, fs)) { fs.m_mtime = m_FileTime; CFile::SetStatus(szFile, fs); } Or you can try File Handling Routines
Thanks, I figured it out in the end, i used Code: timestamp = ctime(&buf.st_mtime); Only thing was ctime was depeciated but it works for what I needed(was only a tempory solution to the bigger picture)