2000-09-05 13:16:19 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2000-09-14 17:53:12 +00:00
|
|
|
#include <fstream>
|
|
|
|
|
2000-09-05 13:16:19 +00:00
|
|
|
#include "support/lyxlib.h"
|
|
|
|
#include "LString.h"
|
|
|
|
|
2000-09-14 17:53:12 +00:00
|
|
|
bool lyx::copy(string const & from, string const & to)
|
2000-09-05 13:16:19 +00:00
|
|
|
{
|
2000-09-15 10:24:15 +00:00
|
|
|
std::ifstream ifs(from.c_str());
|
2000-09-14 17:53:12 +00:00
|
|
|
if (!ifs) return false;
|
2002-01-30 13:15:19 +00:00
|
|
|
std::ofstream ofs(to.c_str(),
|
|
|
|
std::ios::binary | std::ios::out | std::ios::trunc);
|
2000-09-14 17:53:12 +00:00
|
|
|
if (!ofs) return false;
|
|
|
|
ofs << ifs.rdbuf();
|
|
|
|
if (ofs.good()) return true;
|
|
|
|
return false;
|
2000-09-05 13:16:19 +00:00
|
|
|
}
|