Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

monitoring file and directory events in Linux you will read about inotify in the

ID: 3822982 • Letter: M

Question

monitoring file and directory events in Linux

you will read about inotify in the Love or Kerrisk textbooks, on read about inotify in section 7 of the man pages (man 7 inotfiy) to answer the following questions.

Explain in your own words the purpose of the inotify API. Give an example of where it could be used.

List the three major functions that implement and use an inotify instance. Give a short description of each function.

What functions can be used to access (read) inotify events?

How is an instance of inotify destroyed?

Explanation / Answer

The inotify API provides a mechanism for monitoring THE filesystemS IN a
events.
Inotify can be used for monitoring the individual files, or to
monitor directories.
When a directory is monitored already then, inotify will
return events for the directory itself, and for files inside the
directory.
example;
inotify api creates an inotify instance and returns a file of
descriptor referring to the inotify instance.
The more recent
`inotify_init1(2) is like inotify_init(2), which has a flags argument
that provides access to some extra functionality.
inotify instance method:
1.It is used to select call() method.
2.BY using this it will return standard files
3.inotify_event structure which is read from inotifyinstance.
Reading events from an inotify file descriptor to determine what events we have.

inotify() destroy is used to destroy and recreate the system