MoveFileEx function kernel32

Win32Result<bool> MoveFileEx(
  1. PCWSTR lpExistingFileName,
  2. PCWSTR? lpNewFileName,
  3. MOVE_FILE_FLAGS dwFlags
)

Moves an existing file or directory, including its children, with various move options.

To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-movefileexw.

Implementation

Win32Result<bool> MoveFileEx(
  PCWSTR lpExistingFileName,
  PCWSTR? lpNewFileName,
  MOVE_FILE_FLAGS dwFlags,
) {
  final result_ = MoveFileExW_Wrapper(
    lpExistingFileName,
    lpNewFileName ?? nullptr,
    dwFlags,
  );
  return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}