Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a beginner's question: how to write a renaming program?

Status
Not open for further replies.

starfish88

Technical User
Jun 20, 2005
2
US
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
 
Is it a forum for freeware homeworks?
Read this forum rules...
It's so simple specifications. Present your code snippet then ask help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top