lyx_mirror/src/support/copy.C
Lars Gullik Bjønnes d6665cba42 get rid of dead code, some new functions constify variables.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1041 a592a061-630c-0410-9148-cb99ea01b6c8
2000-09-26 13:54:57 +00:00

19 lines
394 B
C

#include <config.h>
#include <fstream>
#include "support/lyxlib.h"
#include "LString.h"
#include "support/filetools.h"
bool lyx::copy(string const & from, string const & to)
{
std::ifstream ifs(from.c_str());
if (!ifs) return false;
std::ofstream ofs(to.c_str(), std::ios::out|std::ios::trunc);
if (!ofs) return false;
ofs << ifs.rdbuf();
if (ofs.good()) return true;
return false;
}