CopyFileAsync

Last Updated2026-07-30
Created At2026-07-30

Copies a file without blocking the game thread. Existing destinations are overwritten.

native void CopyFileAsync(const char[] newpath, const char[] oldpath, FileOpCallback callback, any data = 0, bool use_valve_fs = false, const char[] source_path_id = "GAME", const char[] dest_path_id = "DEFAULT_WRITE_PATH")

Parameters

const char[] newpath
Path to the destination file.
const char[] oldpath
Path to the existing source file.
Callback invoked on completion.
any data
User data passed to the callback.
bool use_valve_fs
If true, use the Valve filesystem.
const char[] source_path_id
Valve filesystem search path for the source.
const char[] dest_path_id
Valve filesystem search path for the destination.

Return Value

void

Error

The callback is invalid, the async worker is shutting down, or Valve async operations are unavailable.