From 45e00fd7c7695adb9d69e8621ab76fdfa085900b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 5 Oct 2018 07:15:55 +0200 Subject: Fix for windows & mingw --- src/FileUtil.cpp | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'src/FileUtil.cpp') diff --git a/src/FileUtil.cpp b/src/FileUtil.cpp index e317304..ae24996 100644 --- a/src/FileUtil.cpp +++ b/src/FileUtil.cpp @@ -1,6 +1,5 @@ #include "../include/FileUtil.hpp" #include -#include #if OS_FAMILY == OS_FAMILY_POSIX #include @@ -8,7 +7,7 @@ #include #include #else -#include +#include // Copied from linux libc sys/stat.h: #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) @@ -498,30 +497,4 @@ namespace sibs return pathIndex == path.size() && otherPathIndex == otherPath.size(); } - - Result copyFile(const FileString &src, const FileString &dst) - { - ifstream srcFile(src.c_str(), ios::binary); - if(!srcFile) - { - string errMsg = "Failed to open file "; - errMsg += toUtf8(src); - errMsg += ", reason: "; - errMsg += strerror(errno); - return Result::Err(errMsg); - } - - ofstream dstFile(dst.c_str(), ios::binary); - if(!dstFile) - { - string errMsg = "Failed to create/overwrite file "; - errMsg += toUtf8(dst); - errMsg += ", reason: "; - errMsg += strerror(errno); - return Result::Err(errMsg); - } - - dstFile << srcFile.rdbuf(); - return Result::Ok(true); - } } -- cgit v1.2.3