Thank you for the suggestions. So after looking over the ASIO extension, I have basically this implemented in my project and though I see a change when
I add a file to the directory being monitored, I see no futher changes.
I'm trying to monitor a directory and when a file is added, I will then make
mods to it and move it elsewhere. I'm new to boost, and my understanding is that this is being
executed within a thread, and it acts like its blocking.
Any help much appreciated.
void create_file_handler(const boost::system:error_code &ec,
const boost::asio::dir_monitor_event &ev)
{
cout << "file name: " << ev.filename << endl;
cout << " type : " << ev.type << endl;
// now edit file ...
}
// from main()
boost::thread t;
{
boost::asio::io_service io_service;
boost::asio::dir_monitor dm(io_service);
dm.add_directory("C:\\Users\\SRD\\DirA");
boost::asio::dir_monitor_event ev = dm.monitor();
dm.async_monitor(create_file_handler);
t = boost::thread(boost::bind(&boost::asio::io_service::run, boost::refio_service)));
boost::system_time time = boost::get_system_time();
time += boost::posix_time::time_duration(0, 0, 1);
boost::thread::sleep(time);
}
t.join();
io_service.reset();
// now do app stuff ..