| 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 | |
| 52 | int main( int argc, char * argv[] ) |
no outgoing calls