IO::CopyFile

IO::CopyFile(sourceFileName, destinationFileName): bool

Makes a copy of source file or folder to destination file or folder and returns TRUE if action was successful.

In server scripts, IO:: functions are available only if server configuration variable NXSL.EnableFileIOFunctions is enabled (change requires server restart). They are always available in scripts run by nxscript.

Table 1. Parameters

sourceFileName

String

Source file/folder name

destinationFileName

String

Destination file/folder name

Return

TRUE if copy was successful and FALSE if not.

IO::CopyFile("/tmp/source", "/tmp/destination") // Will copy "/tmp/source" file content to "/tmp/destination" file.