Hello,
it will be possible to add a"force" option to Rename() ?
Example, i have this two file
file1.txt
file2.txt
I would like to rename file1.txt to file2.txt and overwrite file2.txt.
Thanks
Force rename and replace old file
Re: Force rename and replace old file
I guess you just need to use Exists() to check if file2 exists, if it does, delete it, then rename the file1 to file2.
usage same as default Rename Command:
Code: Select all
Function My_Rename(OldFileName$, NewFileName$)
if Exists(NewFileName$) then DeleteFile(NewFileName$)
Rename(OldFileName$, NewFileName$)
endfunctionCode: Select all
My_Rename(File1$, File2$)Re: Force rename and replace old file
Thanks Bugala!
It's a good idea
I don't think to create a function and use it...
It's a good idea
I don't think to create a function and use it...