I've been trying to figure out a way to simple copy all the files in the current working directory to another folder. I've done this before using system("XCOPY... but wanted to get away from using those old command line commands. I tried using filesystem and copyfile but nothing seems to not error out in Visual Studio.
The basis behind this is to quickly copy a group of icons to a folder and overwrite any that are there while doing other things. This way my engineers don't have to open file explorer and select all the icons and copy and paste them. Trying to make things fast and efficient.
I apologize that I don't have any code as of yet. As I said I was trying but nothing has been working. So I am really asking for some ideas or places to start or sites to visit as I have searched and search and I can't seem to find anything simple.
Some may notice the little countdown timer at the end. I found that on a site and it's pretty cool. The only issue I have with it is that if it is set higher than 9 the trailing 0 stays behind all the single digit numbers until the end. If anyone sees something wrong with that please let me know.
this begs multi-threading though because now what? Copy one file at a time again, the slow way? You would want to spawn a copy thread for each acceptable file name, I think, but that could flood you, maybe want to put a reference counter and keep it to 10 or so at a time?
you can emit backspace characters to the console to clear the extra character it or look at nonstandard functions like gotoxy or ncurses tools to make a cleaner countdown.
here is the count down. I will leave it to you to append seconds and erase it if you want to go there. It probably needs to have the # of spaces written match the log10(x) idea or it will append an extra space for each power of 10 as-is. /lazy me. It works for 100 etc too.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
cout << "this program ends in:";
cout <<" "<< x--;
for(int i = 0; i < log10(x)+1; i++)
cout << "\b";
if you want extra credit you can use ms and convert it to a float to show the fractions of a second going by.