I have a set of simulations that generate a significant number of large files which can only be stored on an account with a very small disk quota. On my windows machine I have a hard drive with more than enough empty space, but I cannot directly store my simulation results there, leading me to write this small windows program which watches one directory and moves all the created files to my hard drive. There are probably better ways to do it, but as of right now I am unaware of them.
This c++ program works by first asking for a source and destination directory. It verifies that the directories exist then enters an infinite loop where is spends most of its time sleeping. Once a minute it checks the source directory for any files older than a few minutes and copies them to the destination directory, and then it goes back to sleep.
I have attached the source code and windows executable below. The program was originally compiled with Visual Studio 2008 and should work with Windows XP or newer.