MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CopyFile

Method CopyFile

lib/base/utility.cpp:730–739  ·  view source on GitHub ↗

* Copies a source file to a target location. * Caller must ensure that the target's base directory exists and is writable. */

Source from the content-addressed store, hash-verified

728 * Caller must ensure that the target's base directory exists and is writable.
729 */
730void 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.

Callers

nothing calls this directly

Calls 2

BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected