重命名文件


描述

With this action you can rename any file that has been saved by your game. You give the name of the file to change (as a string) and then the new name (also as a string and including the file extension), and the file will be renamed. Note that you cannot rename any file that was bundled as an Included File with your game (see the section on The File System for more information).


动作语法:

Rename File Syntax


参数:

参数 描述
文件名 The name (as a string) of the file to rename
新名称 The new name (as a string) for the file


例如:

Rename File Example
The above action block code will check to see if the file "checkpoint.sav" exists, and if it does it then checks to see if the file "checkpoint_OLD.sav" exists. If that file exists as well, then it is deleted, and then the original "checkpoint.sav" file is renamed to "checkpoint_OLD.sav". Finally a buffer is saved as "checkpoint.sav" (essentially we are backing up a saved buffer file each time we save it, so that there is always a "current" save and an "old" save file).