Java WatchService not generating events while watching mapped drives

后端 未结 5 1844
春和景丽
春和景丽 2020-11-30 05:58

I implemented a file watcher but I noticed that java nio file watcher doesn\'t generate events for files being copied on mapped drives. For instance, I\'ve run the file watc

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 06:30

    I too ran into this and reached the same conclusion as everyone else here (CIFS + inotify = no go).

    However, since my workflow happened to depend on both remote mounts and auto-compile tools that rely on inotify, I ended up building a (fairly desperate & hacky) solution which basically just uses polling to watch for changes and then touches the same files again on the mounted side, which does seem to fire off inotify events. It is not my proudest moment.

    Having said that, it does work, so, enjoy: http://github.com/rubyruy/watchntouch

提交回复
热议问题