11

Is there a portable library to watch for filesystem changes without polling?

I know there is

but i have not found any portable wrapper for those.

Is there a portable wrapper for Linux, Windows and OS X or a subset of those?

Community
  • 1
  • 1
flob
  • 3,760
  • 2
  • 34
  • 57

2 Answers2

5

QFileSystemWatcher -- Qt is very cross-platform.

spraff
  • 32,570
  • 22
  • 121
  • 229
  • Sounds like a possible solution. But I experienced the pre-build moc and slow compile/linking unsatisfactory. I still hope a leaner solution exists (without cutting it out of Qt by hand.) – flob Sep 08 '11 at 12:52
  • CMake makes the MOC stuff very easy, QtCore is a very lightweight library, I never noticed significant extra time to compile/link but you might try GNU Gold as a faster replacement linker http://en.wikipedia.org/wiki/Gold_(linker) – spraff Sep 08 '11 at 14:13
  • FYI: On Windows `QFileSystemWatcher` and `FindNextChangeNotification` wont work correctly on network shares on linx servers which use an outdated version of samba (we have a server running with version 3.0.22, which problems). In such cases you have to force QFileSystemWatcher to use the polling implementation. – smerlin Mar 15 '12 at 08:24
1

Have a look at jnotify. It's written in java and can run on all the major OSes.

slm
  • 15,396
  • 12
  • 109
  • 124