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

Function copy_file

example/mbcopy.cpp:33–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 // differ, so provide a not-very-smart replacement.
32
33 void copy_file( const fs::wpath & from, const user::mbpath & to )
34 {
35 fs::ifstream from_file( from, std::ios_base::in | std::ios_base::binary );
36 if ( !from_file ) { std::cout << "input open failed\n"; return; }
37
38 fs::ofstream to_file( to, std::ios_base::out | std::ios_base::binary );
39 if ( !to_file ) { std::cout << "output open failed\n"; return; }
40
41 char c;
42 while ( from_file.get(c) )
43 {
44 to_file.put(c);
45 if ( to_file.fail() ) { std::cout << "write error\n"; return; }
46 }
47
48 if ( !from_file.eof() ) { std::cout << "read error\n"; }
49 }
50}
51
52int main( int argc, char * argv[] )

Callers 3

mainFunction · 0.70
do_not_callFunction · 0.50
copy_file_testsFunction · 0.50

Calls

no outgoing calls

Tested by 2

do_not_callFunction · 0.40
copy_file_testsFunction · 0.40