LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   monitoring file added to a directory / subdirectories (https://www.linuxquestions.org/questions/programming-9/monitoring-file-added-to-a-directory-subdirectories-413663/)

abhi_abhijith 02-09-2006 10:55 PM

monitoring file added to a directory / subdirectories
 
hi...

i need pointers to books/website...

'm trytin to write a daemon ( using C )that monitors files of particular type(eg. text or pdfs) copied onto the hard disk. the daemon should detect the above n write the file name (along with the absolute path) to a file.

please DO NOT give me the code explicitly...


---thank u

Agrouf 02-10-2006 04:25 AM

google for the dnotify API or inotify. There is a project called dnotify as well.

abhi_abhijith 02-10-2006 05:14 AM

thanks... but i ve done that.. but...
 
i do not want the ready-to-use API or the tool... i really want to learn how to write such tools.. :) so can u please give me any references, using which i can learn :scratch:

-- Thank YOu :)

primo 02-11-2006 12:41 AM

The advice given to you is good. Inotify is a kernel patch that implements a mechanism which is better than dnotify (based on directories). See fcntl(2) for the available help on it.

You may see inotify at:
http://www-128.ibm.com/developerwork...l-inotify.html

There's FAM also at:
http://oss.sgi.com/projects/fam/

abhi_abhijith 02-13-2006 07:25 AM

monitoring entire
 
hi...

if i set the directory to be watched as "/" using dnotify, does it monitor only the contents of "/" or does it also watch the sub-directories????

If dnotify cannot achive this can this be done using inotify???

-Thank You


All times are GMT -5. The time now is 06:15 PM.