LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-09-2006, 10:55 PM   #1
abhi_abhijith
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Rep: Reputation: 0
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
 
Old 02-10-2006, 04:25 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
google for the dnotify API or inotify. There is a project called dnotify as well.

Last edited by Agrouf; 02-10-2006 at 04:27 AM.
 
Old 02-10-2006, 05:14 AM   #3
abhi_abhijith
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
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

-- Thank YOu
 
Old 02-11-2006, 12:41 AM   #4
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
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/
 
Old 02-13-2006, 07:25 AM   #5
abhi_abhijith
LQ Newbie
 
Registered: Feb 2006
Posts: 5

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy 3 files to a directory and all subdirectories? snip128 Linux - Newbie 9 08-12-2005 09:18 PM
why can't the /bin directory contain subdirectories? learnfast Linux - Newbie 2 03-09-2005 11:31 AM
monitoring directory to get the modified file names appas Programming 1 09-06-2004 04:56 AM
howto mv a set of subdirectories to an other directory? Lleb_KCir Linux - General 1 06-13-2004 11:33 PM
read directory and subdirectories skora Programming 3 10-27-2003 10:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration