summaryrefslogtreecommitdiff
path: root/utils/filelib.cc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/filelib.cc')
-rw-r--r--utils/filelib.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/filelib.cc b/utils/filelib.cc
index a0969b1a..d206fc19 100644
--- a/utils/filelib.cc
+++ b/utils/filelib.cc
@@ -2,6 +2,12 @@
#include <unistd.h>
#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <cstdlib>
+#include <cstdio>
+#include <sys/stat.h>
+#include <sys/types.h>
using namespace std;
@@ -32,3 +38,16 @@ void MkDirP(const string& dir) {
}
}
+#if 0
+void CopyFile(const string& inf, const string& outf) {
+ WriteFile w(outf);
+ CopyFile(inf,*w);
+}
+#else
+void CopyFile(const string& inf, const string& outf) {
+ ofstream of(outf.c_str(), fstream::trunc|fstream::binary);
+ ifstream in(inf.c_str(), fstream::binary);
+ of << in.rdbuf();
+}
+#endif
+