SA-MP Forums Archive
Code to rename a file ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Code to rename a file ? (/showthread.php?tid=497399)



Code to rename a file ? - FilesMAker - 26.02.2014

I'm searching for a code to rename a file!


Respuesta: Code to rename a file ? - CuervO - 26.02.2014

By natives you can't.

You must read whatever is on the file (keeping it on the memory), deleting said file, recreating it with the new name and then write whatever that was stored when you read it.

That is what basically most file processing systems do with their files.


Re: Code to rename a file ? - FilesMAker - 26.02.2014

I have a big file, it may bug or something, it ll not be fast and safe !


Re: Code to rename a file ? - Yashas - 26.02.2014

You can rename files using this plugin:
https://sampforum.blast.hk/showthread.php?tid=92246

Use the move file function and keep the destination with the same directory with a different file name.