lang • move

MOVE

MOVE OldName TO NewName

Renames or moves a file or a directory.

Oldname and NewName can be located on different directories, but must be located on the same device.

If you want to move a file whatever its location is, do the following:

Try Move OldName To NewName
If Error Then
  Try Copy OldName To NewName
  If Not Error Then Kill OldName
Endif

MOVE ... KILL

MOVE OldName KILL NewName MOVE OldName DOWNTO NewName

Since 3.11

Renames or moves a file or a directory, erasing the destination file first, the two operations being atomic.

Oldname and NewName can be located on different directories, but must be located on the same device.

You have to use this function when you are replacing a file that must always exist.

MOVE ... DOWNTO ... is a deprecated syntax introduced in Gambas 3.10.

See also