* Copies a source file to a target location. * Caller must ensure that the target's base directory exists and is writable. */
| 728 | * Caller must ensure that the target's base directory exists and is writable. |
| 729 | */ |
| 730 | void Utility::CopyFile(const String& source, const String& target) |
| 731 | { |
| 732 | namespace fs = boost::filesystem; |
| 733 | |
| 734 | #if BOOST_VERSION >= 107400 |
| 735 | fs::copy_file(fs::path(source.Begin(), source.End()), fs::path(target.Begin(), target.End()), fs::copy_options::overwrite_existing); |
| 736 | #else /* BOOST_VERSION */ |
| 737 | fs::copy_file(fs::path(source.Begin(), source.End()), fs::path(target.Begin(), target.End()), fs::copy_option::overwrite_if_exists); |
| 738 | #endif /* BOOST_VERSION */ |
| 739 | } |
| 740 | |
| 741 | /* |
| 742 | * Renames a source file to a target location. |