tags:

views:

155

answers:

2

On a server, a process monitors the files in a Unix file system.

If a client sends the file name to be monitored, the server has to send the report to the client whether that file got changed or deleted.

For server-client communication, we should use either message queues or sockets.

For every change in the file, the server has to notify that change.

For all changes in all files, the server has to maintain one logfile so that user can view it through the command line interface.

Server could use two threads: one for communication, the other for monitoring.

How can you do this efficiently?

+3  A: 

Have a look at inotify at http://en.wikipedia.org/wiki/Inotify - linux only I'm afraid.

BSD has kqueue - see http://en.wikipedia.org/wiki/Kqueue.

Dipstick
A: 

See also:

http://benkibbey.wordpress.com/bubblegum/

ceeit