CopyFile function kernel32
Copies an existing file to a new file.
To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-copyfilew.
Implementation
Win32Result<bool> CopyFile(
PCWSTR lpExistingFileName,
PCWSTR lpNewFileName,
bool bFailIfExists,
) {
final result_ = CopyFileW_Wrapper(
lpExistingFileName,
lpNewFileName,
bFailIfExists ? TRUE : FALSE,
);
return .new(value: result_.value.i32 != FALSE, error: result_.error);
}