Axosoft / nsfw

A super fast and scaleable file watcher that provides a consistent interface on Linux, OSX and Windows
MIT License
901 stars 113 forks source link

Ubuntu shared folder file watch fails #186

Closed rmmoreira84 closed 2 weeks ago

rmmoreira84 commented 2 weeks ago

Hello,

I'm using:

I've mounted a remote folder and I'm trying to monitor file changes. Adding or removing a file from the share doesn't trigger anything on NSFW.

Does anyone have the same behavior? Any suggestions?

Thank you.

julianmesa-gitkraken commented 2 weeks ago

Can you check if inotifywait works on that directory? Does your code work on other directory?

From manual:

Inotify reports only events that a user-space program triggers through the filesystem API. As a result, it does not catch remote events that occur on network filesystems. (Applications must fall back to polling the filesystem to catch such events.) Furthermore, various pseudo-filesystems such as /proc, /sys, and /dev/pts are not monitorable with inotify.

rmmoreira84 commented 2 weeks ago

Hi @julianmesa-gitkraken

Thanks for the quick answer.

I don't know if it helps, but I also tested with chokidar and the notification of the events works properly.

Thank you.

rmmoreira84 commented 2 weeks ago

Hi @julianmesa-gitkraken ,

I've validated and the inotifywait doesn't give any event when I add a new file on the share. Do you think there can be any work around?

I've been debugging the code and, on the pollForEvents (NSFW.cpp), it doesn't surface any event on a shared folder.

Thanks for the help.

julianmesa-gitkraken commented 2 weeks ago

NSFW is based on inotify so there is no solution. I guess you need to use polling from filesystem as the manual says