So i'm having trouble finding the Problem. It never moves the file to it's new destination. Maybe im just too tired but please give me some ideas why it's not working.
Here's the relevant code:
void Logger::RotateLogFiles() {
ostringstream newpath;
string oldpath;
this->logtime = time(0);
this->now = localtime(&this->logtime);
newpath << this->archive << "/" << this->now->tm_mday << "-" << this->now->tm_mon + 1 << "-" << this->now->tm_year + 1900 << "/" << this->filepath.substr(this->filepath.find(".")+1, string::npos);
if(rename(this->filepath.c_str(), newpath.str().c_str()) != 0) MessageBox(NULL, L"Error moving Logfile.", L"Error", MB_OK | MB_ICONERROR);
}