seregazhuk / reactphp-fswatch

Watch files for changes with fswatch and ReactPHP
8 stars 2 forks source link

isFile() returns false even if file was changed #1

Open mattsches opened 3 years ago

mattsches commented 3 years ago

Hi Sergey, I implemented your example code, put a file data.txt into var/data and monitored it: $watcher = new FsWatch('var/data', $loop,);

Now if I edit and save the file, a Change event is received, but $event->isFile() always returns false, thus:

Dir: /var/www/html/var/data/data.txt was changed

I'm in a Docker container running Debian 10.4.

seregazhuk commented 3 years ago

Hi @mattsches! Thank you for the issue. Yes, I get the same weird behavior of fswatch in Docker, but on my Mac everything works fine. It looks like on Linux the bitmask doesn't contan File change 🤷‍♂️

docker-compose exec reactphp-fswatch fswatch -xrn /var/www/tests 

Then for example touch test.txt and the output of fswatch is the following:

/var/www/tests/test.txt 2

Showing that there was only the creation of something. Any help will be appreciated.