inotify.php 325 B

12345678910111213
  1. <?php
  2. // Open an inotify instance
  3. $fd = inotify_init();
  4. // Watch __FILE__ for metadata changes (e.g. mtime)
  5. $watch_descriptor = inotify_add_watch($fd, __DIR__ . '/php', IN_MODIFY | IN_MOVED_FROM | IN_CREATE | IN_DELETE | IN_ISDIR);
  6. while (true)
  7. {
  8. // Read events
  9. $events = inotify_read($fd);
  10. print_r($events);
  11. }