starfish88
Technical User
Can someone kindly show me how to write a little C++ programs that:
First program)
It will do error-checking to see if the target input file does exit locally. If not, will print message saying the file is not found, pause, and wait for a keystroke to continue.
If the target file is found, let's say it is called "input.txt," the program will rename it as [CONSTANT_NAME]_[MMDDYY-HHMMSS].txt, where MMDDYY-HHMMSS are month, date, year, hour, minute, second, and let's say the CONSTANT_NAME is my login name. So, a possible output will be:
starfish88_062005-010854.txt
Second program)
After renaming the previous program, I have a couple other files which have a different extension, such as .htm, .doc, etc., and I want to rename them according to the name of the above file. Thus:
somefile.htm --> starfish88_062005-010854.htm
somefile.doc --> starfish88_062005-010854.doc
Thank you very much.
Will
First program)
It will do error-checking to see if the target input file does exit locally. If not, will print message saying the file is not found, pause, and wait for a keystroke to continue.
If the target file is found, let's say it is called "input.txt," the program will rename it as [CONSTANT_NAME]_[MMDDYY-HHMMSS].txt, where MMDDYY-HHMMSS are month, date, year, hour, minute, second, and let's say the CONSTANT_NAME is my login name. So, a possible output will be:
starfish88_062005-010854.txt
Second program)
After renaming the previous program, I have a couple other files which have a different extension, such as .htm, .doc, etc., and I want to rename them according to the name of the above file. Thus:
somefile.htm --> starfish88_062005-010854.htm
somefile.doc --> starfish88_062005-010854.doc
Thank you very much.
Will