28 printf(
"Watching directory '.'...\n Press any key to exit.\n");
32 watch.getChanges(lstChanges);
34 for (it = lstChanges.begin(); it != lstChanges.end(); it++)
36 cout <<
"changed: '" << it->path <<
"' ";
37 if (it->isDir) cout <<
"isDir ";
38 if (it->eventModified) cout <<
"modified ";
39 if (it->eventCloseWrite) cout <<
"close_write ";
40 if (it->eventDeleted) cout <<
"deleted ";
41 if (it->eventMovedTo) cout <<
"moved_to ";
42 if (it->eventMovedFrom) cout <<
"moved_from ";
43 if (it->eventCreated) cout <<
"created ";
44 if (it->eventAccessed) cout <<
"accessed";
49 std::this_thread::sleep_for(100ms);
64 catch (std::exception& e)
66 std::cout <<
"MRPT exception caught: " << e.what() << std::endl;
71 printf(
"Untyped exception!!");
std::deque< TFileSystemChange > TFileSystemChangeList
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
This class subscribes to notifications of file system changes, thus it can be used to efficiently sta...
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.