| HelloWorld |
Mar 16th, 2005 1:21 AM |
File Input Problem
Hello, I have recently started working on a project which needs to read in all the .txt files in a folder. Currently the way it works is incredibly inefficient. The files are all saved in 'endresults-YEAR-MM-DD_HH-MM-SS.txt' format where YEAR is the year, MM the month, DD the day, HH the hour, MM the minute, and SS the second is the exact time you quit the program. Unfortunately the program doesn't know exactly what files to look for, so it iterates a loop for every second between 2004 and 2006. I never let this run to completion, but it would take around I day I would estimate - rending the program useless.
If someone could think of a more efficient way to check every combination it would be appreciated, or better yet if someone could tell me how to get all of the contents of a folder in C++ I think that would be the best route to go.
|