Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

19.3. inotify Events

When we create or modify a watch using inotify_add_watch(), the mask bit-mask argument identifies the events to be monitored for the given pathname. The event bits that may be specified in mask are indicated by the In column of Table 19-1.

Table 19-1. inotify events
Bit valueInOutDescription
IN_ACCESSFile was accessed (read())
IN_ATTRIBFile metadata changed
IN_CLOSE_WRITEFile opened for writing was closed
IN_CLOSE_NOWRITEFile opened read-only was closed
IN_CREATEFile/directory created inside watched directory
IN_DELETEFile/directory deleted from within watched directory
IN_DELETE_SELFWatched file/directory was itself deleted
IN_MODIFYFile was modified
IN_MOVE_SELFWatched file/directory was itself moved
IN_MOVED_FROMFile moved out of watched directory
IN_MOVED_TOFile moved into watched directory
IN_OPENFile was opened
IN_ALL_EVENTS Shorthand for all of the above input events
IN_MOVE Shorthand for IN_MOVED_FROM | IN_MOVED_TO
IN_CLOSE Shorthand for IN_CLOSE_WRITE | IN_CLOSE_NOWRITE
IN_DONT_FOLLOW Don’t dereference symbolic link (since Linux 2.6.15)
IN_MASK_ADD Add events to current watch mask for pathname
IN_ONESHOT Monitor pathname for just one event
IN_ONLYDIR Fail if pathname is not a directory (since Linux 2.6.15)
IN_IGNORED Watch was removed by application or by kernel
IN_ISDIR Filename returned in name is a directory
IN_Q_OVERFLOW Overflow on event queue
IN_UNMOUNT File system containing object was unmounted



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial