SYS_MoveFile Function

Action

Moves the specified file.

Syntax

SYS_MoveFile (sToMove, sToMoveTo)
Variable Description
sToMove The name of the file to move. STRING.
sToMoveTo The new name or directory for the file. STRING.

Notes

SYS_MoveFile can be used to rename a file or move it to a different directory. An exception is raised if sToMove does not exist or if sToMoveTo is a file that already exists.

Windows

The files sToMove and sToMoveTo must reside on the same drive.

Windows Platforms

SYS_MoveFile is executed by the Agent process, not the Silk Test Classic process. To affect the host process, use the function with the hHost notation or machine handle operator. For more information about the machine handle operator and hHost, see Machine handle operator.

Example

[ ] const sOrigFile = "gui.t"
[ ] const sNewFile = "gui.tmp"
[ ] SYS_MoveFile (sOrigFile, sNewFile)
[-] if SYS_FileExists (sNewFile)
	[ ] Print ("File was moved")