]> git.lyx.org Git - lyx.git/blob - src/support/copy.C
merge a few more cygwin patches
[lyx.git] / src / support / copy.C
1 #include <config.h>
2
3 #include <fstream>
4
5 #include "support/lyxlib.h"
6 #include "LString.h"
7
8 bool lyx::copy(string const & from, string const & to)
9 {
10         std::ifstream ifs(from.c_str());
11         if (!ifs) return false;
12         std::ofstream ofs(to.c_str(),
13                           std::ios::binary | std::ios::out | std::ios::trunc);
14         if (!ofs) return false;
15         ofs << ifs.rdbuf();
16         if (ofs.good()) return true;
17         return false;
18 }