Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO file monitoring help
From: Igor R (boost.lists_at_[hidden])
Date: 2013-04-11 05:22:31


<...>
> {
> 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);
> }

Note that at this point io_service and dm get destroyed.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net