#include "support/lyxlib.h"
+namespace lyx {
+
+
using std::ifstream;
using std::ofstream;
using std::ios;
bool lyx::support::copy(string const & from, string const & to)
{
- ifstream ifs(from.c_str(), ios::binary);
+ ifstream ifs(from.c_str(), ios::binary | ios::in);
if (!ifs)
return false;
- ofstream ofs(to.c_str(),
- ios::binary | ios::out | ios::trunc);
+
+ ofstream ofs(to.c_str(), ios::binary | ios::out | ios::trunc);
if (!ofs)
return false;
+
ofs << ifs.rdbuf();
- if (ofs.good())
- return true;
- return false;
+ return ofs.good();
}
+
+
+} // namespace lyx