So I wrote a beginner's program to wipe out some files and copy some updated ones in their place. I used ALOT of system( ) commands and decided now it was time to put some bigger boy pants on and do things right. Well tried to use filesystem. It starts to remove the contents of the first directory then crashes.
This is the event log from Windows:
Faulting application name: Alter_MP_Folders.exe, version: 0.0.0.0, time stamp: 0x5f971c2c
Faulting module name: ucrtbase.dll, version: 10.0.18362.1110, time stamp: 0x100b54ae
Exception code: 0xc0000409
Fault offset: 0x0009efbb
Faulting process id: 0x3ff8
Faulting application start time: 0x01d6abcc3474ae4b
Faulting application path: C:\Users\sboudreaux.SSI-LT33\Desktop\MP Test\Alter_MP_Folders.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: ebe3d0ac-9ded-4c35-b742-c8e864d07c08
Faulting package full name:
Faulting package-relative application ID:
Trying to figure out what is going on here. Any help would be appreciated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
//
#include <iostream>
#include <time.h>
#include <Windows.h>
#include <filesystem>
using namespace std;
int main()
{
cout << endl << endl << " Altering Media Player Folders... Please wait..." << endl << endl << endl << endl;
Sleep(2000);
std::filesystem::remove_all("c:/synergyii/cdDefaultContents/");
std::filesystem::remove_all("c:/synergyii/h264cdDefaultContents/");
std::filesystem::remove_all("c:/synergyii/mediaplayer/");
Sleep(2000);
std::filesystem::create_directory("c:/synergyii/cdDefaultContents/");
std::filesystem::create_directory("c:/synergyii/h264cdDefaultContents/");
std::filesystem::create_directory("c:/synergyii/mediaplayer/");
Sleep(2000);
std::filesystem::copy("MPFiles/", "c:/synergyii/cdDefaultContents/", std::filesystem::copy_options::recursive);
Sleep(2000);
std::filesystem::copy("MPFiles/", "c:/synergyii/h264cdDefaultContents/", std::filesystem::copy_options::recursive);
Sleep(2000);
std::filesystem::copy("MPFiles/", "c:/synergyii/mediaplayer/", std::filesystem::copy_options::recursive);
Sleep(2000);
cout << endl << endl << " Process Completed!" << endl << endl << endl << endl;
Sleep(3000);
return 0;
}
|