Created
October 24, 2021 16:52
-
-
Save ik5/f833b26852c6b6283391c545d5a006dd to your computer and use it in GitHub Desktop.
PECL inotify example for close_write on watch directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fd = inotify_init(); | |
$watch_descriptor = inotify_add_watch($fd, './watch', IN_CLOSE_WRITE); | |
while (true) { | |
$events = inotify_read($fd); | |
foreach ($events as $event) { | |
print_r($event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment