bool CopyFile(const std::string &src, const std::string &dest) { std::ifstream fin(src.c_str(), std::ios::in | std::ios::binary); if(!fin) { std::cout << "open in file[" << src << "] failed" << std::endl; return false; } std::ofstream fout(dest.c_str(), std::ios::out | std::ios::binary); if(!fout) { std::cout << "open out file[" << dest << "] failed" << std::endl; return false; } fout << fin.rdbuf(); return true; }
时间: 2024-10-10 11:34:46