Action FILE

This action is used when you need to perform actions on the server files.

FILE <action> <fileName> [fileNameTo]

ElementPossible Values ​​Description
actionaction:[remove / copy / move]Action on the file.
fileNamefilename:[Path]<File.Ext>The path to the file or directory. The path is relative to the server root. When specifying a directory, you must be careful not to delete the files
fileNameTo{...}The destination path to copy or move file. The path is relative to the server root.

Temporary placeholders created by this action

PlaceholderDescription
%fullpath%Absolute path to the file or directory.
%removecount%Shows the number of deleted files.
%filedebug%Shows the errors if it exists.

Examples

  1. Delete all files from the directory /world/playerdata.
EXEC:
  remove_players:
    actions:
    - FILE=action:remove fileName:{/world/playerdata}
    - 'MESSAGE=&aPath to the files to be deleted: &r%fullpath%'
    - 'MESSAGE=&aWe have removed &6&l%removecount% &afiles'
  1. Delete the .dat file of the player when you exit the game.
EXEC:
  rem:
    actions:
    - PLAYER_ID=player:%player% online:false
    - FILE=action:remove fileName:{/world/playerdata/%playerid%.dat}
QUIT:
  rem_quit:
    actions:
    - execute=activator:rem

When a player leaves the game, the server stores information about his inventory, etc. In the file to be deleted, therefore, in order for the file to be deleted, it is necessary to let the server finish the record. In this case, I use the additional rem activator.

  1. Copying and Moving a File
EXEC:
  copy:
    actions:
    - file=action:copy fileName:{/test/1/3/1.txt} fileNameTo:{/test/1/4/5/2.txt}
  move:
    actions:
    - file=action:move fileName:{/test/1/3/1.txt} fileNameTo:{/test/1/4/5/2.txt}