import std.file, ae.sys.file; if ("tmp".exists) "tmp".removeRecurse(); mkdir("tmp"); scope(exit) "tmp".removeRecurse(); INotify.Mask[] events; INotify.WatchDescriptor wd; wd = iNotify.add("tmp", INotify.Mask.create | INotify.Mask.remove, (in char[] name, INotify.Mask mask, uint cookie) { assert(name == "killme"); events ~= mask; if (events.length == 2) iNotify.remove(wd); } ); touch("tmp/killme"); remove("tmp/killme"); socketManager.loop(); assert(events == [INotify.Mask.create, INotify.Mask.remove]);
The global inotify connection.