Skip to content

format

typescript
File.Move(src, dst)

class: File

description

Move the source file to the specified path.

parameter

param_nametypedescription
srcstringThe source file path.
dststringThe destination path.

return

typedescription
void

code example

javascript
function Test(src_path: string, dst_path: string) {  
    File.Move(src_path, dst_path);
    try {
        if (!File.Exists(dst_path)) {
            Debug.Error("File '", src_path, "' has been moved to '", dst_path, "', but dest file does not exist.");
        }
        if (File.Exists(src_path)) {
            Debug.Error("File '", src_path, "' has been moved to '", dst_path, "', but src file still exist.");
        }
    } catch (error) {
        Debug.Error(error);
    }
}