Skip to content

format

typescript
File.Copy(src, dst)

class: File

description

Copy the source file to the specified directory.

parameter

param_nametypedescription
srcstringThe path of the source file.
dststringThe path of the destination file.

return

typedescription
void

code example

javascript
function Test(src_path: string, dst_path: string) {  
	try {
		File.Copy(src_path, dst_path);
		if (!File.Exists(dst_path)) {
			Debug.Error("File '", src_path, "' has been copied to '", dst_path, "', but the destination file does not exist.");
		}
	} catch (error) {
		Debug.Error(error);
	}
}