copy file if destination does not exist */
| 697 | |
| 698 | /* copy file if destination does not exist */ |
| 699 | void |
| 700 | copy_file(const char *dst_folder, const char *dst_name, |
| 701 | const char *src_folder, const char *src_name, |
| 702 | boolean copy_even_if_it_exists) |
| 703 | { |
| 704 | char dst_path[MAX_PATH]; |
| 705 | strcpy(dst_path, dst_folder); |
| 706 | strcat(dst_path, dst_name); |
| 707 | |
| 708 | char src_path[MAX_PATH]; |
| 709 | strcpy(src_path, src_folder); |
| 710 | strcat(src_path, src_name); |
| 711 | |
| 712 | if (!file_exists(src_path)) |
| 713 | error("Unable to copy file '%s' as it does not exist", src_path); |
| 714 | |
| 715 | if (file_exists(dst_path) && !copy_even_if_it_exists) |
| 716 | return; |
| 717 | |
| 718 | BOOL success = CopyFileA(src_path, dst_path, !copy_even_if_it_exists); |
| 719 | if (!success) |
| 720 | error("Failed to copy '%s' to '%s' (%d)", src_path, dst_path, errno); |
| 721 | } |
| 722 | |
| 723 | /* update file copying if it does not exist or src is newer then dst */ |
| 724 | void |
no test coverage detected