File system notification services. A portable C++ alternative.

Started by
5 comments, last by CoffeeMug 20 years, 11 months ago
Win32 API provides a set of functions (look up FindFirstChangeNotification on google) that notify an application about particular changes in the file system. I am sure *nix operating systems provide similar services (although I don't know the details). I am interested in a portable C++ library that provides a consistant interface for these services. I looked through boost's Filesystem library but it doesn't seem to deal with these issues. Also, in case I have to implement such a library myself, could someone point me to similar *nix functions? [edited by - CoffeeMug on May 8, 2003 2:32:00 AM]
Advertisement
That''s actually a major omission from POSIX. Various nonstandard extensions exist for various UNIXes that''ll do this, but the only portable solution is polling.

How appropriate. You fight like a cow.
AFAIK POSIX deals with threading. Is there a reason it should include a standard for file system related tasks?

Anyway, I don''t mind a set of #ifdef''s for every OS I am planning to support...
quote:Original post by CoffeeMug
AFAIK POSIX deals with threading. Is there a reason it should?

Er... do you actually know what POSIX is? It''s a standard for "compliant" unix systems, including C libraries.

How appropriate. You fight like a cow.
quote:Original post by Sneftel
Er... do you actually know what POSIX is?

No I don''t I know very little about unix and anything related to it. I have practically zero unix experience/knowledge.

quote:It''s a standard for "compliant" unix systems, including C libraries.

Thanks. Good to know
*bump*
If you want to monitor changes to a filesystem in *nix the common solution is FAM. The way it works depends on the *nix it's running on (it could just poll, some kernels help it out though).

The GnomeVFS library provides some file monitoring functions (using FAM when available), if you'd like to look at its code.

About a C++ wrapper library: GnomeVFS has a C++ wrapper, but GNOME code (not including GTK+ and other such libraries that are more portable) only offers limited portability (lots of unixes, possibly some other OS's, but most of it hasn't really been ported to Windows as far as I know). Other than that, I don't know.



[edited by - Null and Void on May 8, 2003 3:54:41 PM]

This topic is closed to new replies.

Advertisement