I have a program that has the ability to create a backup of the data currently being used by the program. The program creates a file called Backupmmddyyyy (where mm is the month it was backed up, dd is the day, and yyyy is the year) in a folder located elsewhere called 'Backup'. The 'Backup' folder can contain several of these files, each with a different name. I need to write a function that can use the latest backup file to restore the data to the program. How do I search through a folder to figure out which file is the most recent and then open it if I don't know the file name?
Well, there's two things you can do.
You can use the OS functions or you can use the Boost library. The former is more straightforward, but the latter is portable.
The way i'm looking at it, there's really no way to determine which file was created last in a directory by looking solely at the name of the file. Is there some way to access the properties of a file to check when it was last modified for example?
I've read through all of those links and the problem is simply that those sorts of functions and code are beyond my capabilities. I don't understand how to impliment them and set them up properly. There may not be a simplistic way to get the file information, i dont' know. And google hasn't been much help on this subject either.