
The MOVE command can be used to move files between directories and also to rename files. It takes two arguments as strings, the first one is the current path and name of the file and the second one is the new path/name. MOVE is also able to move or rename directories.
Moves (renames) the file "hello.txt" on the memory card:
OUTMODE -2
MOVE "hello.txt", "newname.txt"
IF LASTERR = 0 THEN
PRINT "the file was renamed successfully"
ELSE
PRINT "something's gone wrong ";
PRINT LASTERR
END IF
MOVE sets the pseudo variable LASTERR to report success or failure. Files that are currently open cannot be moved. Do not move or rename directories which contain files that are open for reading or writing. MOVE is new since version 4.57