
Carlos Rafael Giani wrote:
is a file monitor feature planned for boost.filesystem? I have been looking for a platform independent solution, but there is none (except in toolkits like Qt). Also, so far only inotify (a subsystem in the Linux kernel) can tell me when a file is closed after writing, which is absolutely necessary when watching a plugins/ directory, for example (you don't want to touch the plugins when they're only halfway copied). Several tools watch the plugin directory, but don't care if the plugins are being written or are fully there already. This can lead to instabilities.
I think it is only logical to add this to boost.filesystem, something like set_monitor_callback(pathname, function_object);
If someone plans to do this, I could contribute some code that I wrote to put a C++ wrapper around inotify. However, I'm no longer using this code because of the following misfeature: if I ask to monitor a file that is on an NFS filesystem, I won't get notifications of changes made on other machines. This would not be a problem if the kernel reported an error in this case as I could then fall back to polling. However, it reports no error so I have no way to know whether or not I will get notifications. Phil.