You keep talking about "rename the contents of the file", but you cannot rename the contents of a file.
Please make up your mind whether you want to:
- change the name of a file ("rename")
- change the content of a file ("rewrite")
Also, your code contains lots of stuff that has no bearing on whatever your problem is. Please, as you have been told many times already, provide sufficient input data, what your program does and also what you think your program should do instead.
We can only provide you help if you provide us enough context. Even if this were a code writing service, you still have to tell us exactly what the program should do.
|