|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
#include <unistd.h>
|
|
|
#include <sys/types.h>
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
#include <cstdlib>
|
|
|
#include <cstdlib>
|
|
|
#include <cstring>
|
|
|
#include <cstring>
|
|
|
#include <cerrno>
|
|
|
#include <cerrno>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace CodeDweller {
|
|
|
namespace CodeDweller {
|
|
|
|
|
|
|
|
|
|
|
|
void FileOps::moveFile(std::string const &from, std::string const &to) {
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
if (MoveFile(from.c_str(), to.c_str()) == 0) {
|
|
|
|
|
|
#else
|
|
|
|
|
|
if (rename(from.c_str(), to.c_str()) != 0) {
|
|
|
|
|
|
#endif
|
|
|
|
|
|
throw std::runtime_error("Error moving file \"" + from +
|
|
|
|
|
|
"\" to file \"" + to + "\": " +
|
|
|
|
|
|
FileReference::getErrorText());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
#ifdef _WIN32
|
|
|
char const FilePath::DirectorySeparator = '\\';
|
|
|
char const FilePath::DirectorySeparator = '\\';
|
|
|
#else
|
|
|
#else
|