Search Results

Search found 1 results on 1 pages for 'demic0de'.

Page 1/1 | 1 

  • PHP Inotify Non-blocking way

    - by demic0de
    I am reading a file in linux which is a log file that keeps on updating weather the file has changed and output it to the webpage. i do it using php inotify but my problem is that it is blocking. How can i make php inotify non-blocking so i can do other stuff while it is monitoring the text file?. <?php $fd = inotify_init(); $watch_descriptor = inotify_add_watch($fd, '/tmp/temp.txt', IN_MODIFY); touch('/tmp/temp.txt'); $events = inotify_read($fd); $contents = file_get_contents('/tmp/temp.txt'); echo $contents; inotify_rm_watch($fd, $watch_descriptor); fclose($fd) ?> Or can i do this in java?..Thanks.

    Read the article

1