adds another watch after started watching...
63 signal( SIGABRT ,
sigend );
65 signal( SIGTERM ,
sigend );
67 std::cout <<
"Press ^C to exit demo" << std::endl;
69 bool commonTest =
true;
70 bool useGeneric =
false;
75 path = std::string( argv[1] );
84 if ( std::string( argv[2] ) ==
"true" )
94 efsw::FileWatcher fileWatcher( useGeneric );
96 fileWatcher.followSymlinks(
false );
97 fileWatcher.allowOutOfScopeLinks(
false );
101 std::string CurPath( efsw::System::getProcessPath() );
103 std::cout <<
"CurPath: " << CurPath.c_str() << std::endl;
106 handleWatchID( fileWatcher.addWatch( CurPath +
"test", ul,
true ) );
112 efsw::System::sleep( 100 );
114 efsw::WatchID watchID =
handleWatchID( fileWatcher.addWatch( CurPath +
"test2", ul,
true ) );
119 efsw::System::sleep( 1000 );
120 fileWatcher.removeWatch( watchID );
127 if ( ( err = fileWatcher.addWatch( path, ul,
true ) ) > 0 )
131 std::cout <<
"Watching directory: " << path.c_str() << std::endl;
135 std::cout <<
"Using generic backend watcher" << std::endl;
140 std::cout <<
"Error trying to watch directory: " << path.c_str() << std::endl;
141 std::cout << efsw::Errors::Log::getLastErrorLog().c_str() << std::endl;
147 efsw::System::sleep( 100 );
efsw::WatchID handleWatchID(efsw::WatchID watchid)
Definition: efsw-test.cpp:39
Processes a file action.
Definition: efsw-test.cpp:16
bool isDirectory(const std::string &filename)
Definition: fileutils.cpp:914
void sigend(int signal)
Definition: efsw-test.cpp:9
bool STOP
Definition: efsw-test.cpp:7