I need to copy a .txt file and rename it.
I am only a beginner, Please help me.
any suggestions and comments will do. THANKS in advance. :)
There are numerous ways to copy a file from one location to another, but the most straight-forward method is by using the CopyFile
method, located in the Winapi.Windows
unit...
CopyFile('C:\OriginalFile.txt', 'D:\NewFile.txt', False);
Cross-platform solution
uses System.IOUtils;
TFile.Copy('file.txt','anotherfile.txt');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With