LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Protect File: how to monitor directory effectively? (https://www.linuxquestions.org/questions/programming-9/protect-file-how-to-monitor-directory-effectively-271393/)

iclinux 12-28-2004 11:31 PM

Protect File: how to monitor directory effectively?
 
Hi all,

I have difficulty in Real-time File Protection under Linux.

I consult some documents aout "FAM" and "inotify", which are used for Watching File Changing.But they can only get File Changing Event in a directory, can not get it in the subdirectory--I mean I have to monitor each subdirectory myself, and stop monitoring them if they have been deleted.

Um,I save all directories in a "tree" Data Structure, e.g. if a dirctory P that has subdirectories C1,C2 has been deleted, I stop monitoring P, C1 and C2, then if they three have been restored successfully, I start monitoring them again.It does work if file changing is not frequent.

The problem is that it's not stable if files change frequently, I don't know how to solve it, but I think it may be related to stopping and starting monitoring directories continually.

Will you please make a suggestion for me?

iclinux 12-30-2004 03:02 AM

um, I'm puzzled..


All times are GMT -5. The time now is 05:06 AM.