MCPcopy Create free account
hub / github.com/boostorg/filesystem / copy

Function copy

src/operations.cpp:856–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854 }
855
856 BOOST_FILESYSTEM_DECL
857 void copy(const path& from, const path& to, system::error_code* ec)
858 {
859 file_status s(symlink_status(from, *ec));
860 if (ec != 0 && *ec) return;
861
862 if(is_symlink(s))
863 {
864 copy_symlink(from, to, *ec);
865 }
866 else if(is_directory(s))
867 {
868 copy_directory(from, to, *ec);
869 }
870 else if(is_regular_file(s))
871 {
872 copy_file(from, to, copy_option::fail_if_exists, *ec);
873 }
874 else
875 {
876 if (ec == 0)
877 BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::copy",
878 from, to, error_code(BOOST_ERROR_NOT_SUPPORTED, system_category())));
879 ec->assign(BOOST_ERROR_NOT_SUPPORTED, system_category());
880 }
881 }
882
883 BOOST_FILESYSTEM_DECL
884 void copy_directory(const path& from, const path& to, system::error_code* ec)

Callers 2

mainFunction · 0.50
mainFunction · 0.50

Calls 8

symlink_statusFunction · 0.85
is_symlinkFunction · 0.85
is_directoryFunction · 0.85
is_regular_fileFunction · 0.85
filesystem_errorFunction · 0.85
copy_symlinkFunction · 0.70
copy_directoryFunction · 0.70
copy_fileFunction · 0.70

Tested by

no test coverage detected