update file copying if it does not exist or src is newer then dst */
| 722 | |
| 723 | /* update file copying if it does not exist or src is newer then dst */ |
| 724 | void |
| 725 | update_file(const char *dst_folder, const char *dst_name, |
| 726 | const char *src_folder, const char *src_name, BOOL save_copy) |
| 727 | { |
| 728 | char dst_path[MAX_PATH]; |
| 729 | strcpy(dst_path, dst_folder); |
| 730 | strcat(dst_path, dst_name); |
| 731 | |
| 732 | char src_path[MAX_PATH]; |
| 733 | strcpy(src_path, src_folder); |
| 734 | strcat(src_path, src_name); |
| 735 | |
| 736 | char save_path[MAX_PATH]; |
| 737 | strcpy(save_path, dst_folder); |
| 738 | strcat(save_path, dst_name); |
| 739 | strcat(save_path, ".save"); |
| 740 | |
| 741 | if (!file_exists(src_path)) |
| 742 | error("Unable to copy file '%s' as it does not exist", src_path); |
| 743 | |
| 744 | if (!file_newer(src_path, dst_path)) |
| 745 | return; |
| 746 | |
| 747 | if (file_exists(dst_path) && save_copy) |
| 748 | CopyFileA(dst_path, save_path, FALSE); |
| 749 | |
| 750 | BOOL success = CopyFileA(src_path, dst_path, FALSE); |
| 751 | if (!success) |
| 752 | error("Failed to update '%s' to '%s'", src_path, dst_path); |
| 753 | } |
| 754 | |
| 755 | void |
| 756 | copy_symbols_content(void) |
no test coverage detected