Archived

This topic is now archived and is closed to further replies.

CoffeeMug

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

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites