bulk rename of all the .wav files in one go and updating the text in all the .phr files at another time can leave you in a messy state in the event of a crash (you would have to restart all over again after restoring from backups). you could consider renaming the .wav file and updating its text in the .phr file in one go.
perhaps, using a single map would be easier than having two different vectors. maybe something like this:
a. have a std::map<std::string,std::string> with the original/modified file names as the key and data.
b. recurse the directory (tree) for .wav files and insert the original/modified filenames in the map.
c. i. recurse the directory (tree) for .phr files, open each, and search each line for an instance of the filename text. ii. lookup the file name in the map, if found, rename the .wav file and replace filename text in the .phr file.
d. iterate through the map and rename any remaining .wav files. (which had no entries in the .phr files).
could be a lot easier to do it in python/perl/ruby instead of C++.
Reputation Points: 1159
Solved Threads: 285
Posting Virtuoso
Offline 1,606 posts
since Dec 2006