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,
) {
resolveGetLastError();
final result_ = _CopyFile(
lpExistingFileName,
lpNewFileName,
bFailIfExists ? TRUE : FALSE,
);
return .new(value: result_ != FALSE, error: GetLastError());
}