]> git.lyx.org Git - lyx.git/blob - src/support/copy.C
fix typo that put too many include paths for most people
[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 using std::ifstream;
9 using std::ofstream;
10 using std::ios;
11
12 bool lyx::copy(string const & from, string const & to)
13 {
14         ifstream ifs(from.c_str());
15         if (!ifs)
16                 return false;
17         ofstream ofs(to.c_str(),
18                      ios::binary | ios::out | ios::trunc);
19         if (!ofs)
20                 return false;
21         ofs << ifs.rdbuf();
22         if (ofs.good())
23                 return true;
24         return false;
25 }