Hello programmers,
Can anyone tell me how to rename a file using C?
Ex-
I have a file c:\My Documents\Test File\Test\testLog.log and I would like to have a C program that will run and test to see if the testLog.log file is there first then if so rename it. After it has been renamed the file testLog.log shouldn't be there any more.
Before:
c:\My Documents\Test File\Test\testLog.log
After:
c:\My Documents\Test File\Test\testLog1.log
Do I have to open two files? One being my file and the other being the one I want to rename it to? Then copy all of the info from file1 to file2? Or is there an easier way?
Thanks for your help,
Dan