Does anyone know if Linux has an API command equivalent to the Win32 API function, FindFirstChangeNotification()?
If you know the answer can you please post a very small sample of code that demonstrates the Linux equivalent to the following Win32 code:
quote:Original post by Dire.Wolf Is Linux not advanced enough to support this?
You''re sure to get someone to flame you if nothing else like that, heh . Maybe you should look into how that function works (I''m not sure myself) and make a clone of it. I''m sure Linux can do it, but I''m not sure if it is built it. Good luck .
The whole reason I said that was to get some responses
I don''t want to use timestamps and have to keep polling a directory. Doesn''t Linux support kernel event objects? Using an event object and calling an OS API that waits on the object allows the OS not to schedule the thread. Polling eats CPU cycles and can hurt performance.
Linux MUST have some sort of synchronization primitives?
AFAIK Linux can''t do that yet, as I''ve recently read in a KDE discussion. However, you can be almost certain that somebody''s working on it. I don''t know how hard it would be to implement. Does FindFirstChangeNotification() trigger on any file change below the directory you specify? If so, the implementation could get quite difficult.
cu, Prefect
One line of sourcecode says more than a thousand words.
AFAIK Linux can''t do that yet, as I''ve recently read in a KDE discussion. However, you can be almost certain that somebody''s working on it. I don''t know how hard it would be to implement. Does FindFirstChangeNotification() trigger on any file change below the directory you specify? If so, the implementation could get quite difficult.
cu, Prefect
One line of sourcecode says more than a thousand words.
Yes it does but only if you ask FindFirstChangeNotification to include subdirectories. The pain in the butt with FindFirstChangeNotification is that it doesn''t tell you *which* files changed or how. Most of the time you take a snapshot of the directory (or subdirectories) and then when the change happens you take another snapshot and compare the two. There are subtle issues with this technique but it works well enough.