Skip to content

davlxd/wrap-inotify

Repository files navigation

Table of contents :
 1. Introduction
 2. Details
 3. Usage
 4. Contacts
 5. About License


1.  Introduction
----------------
    Recursively monitor every subdirectories, dynamically add/remove monitors
    if specific events (IN_CREATE/IN_MOVED_TO/IN_DELETE/IN_MOVED_FROM)
    applied to corresponding subdirectories themselve.

2.  Details
-----------
    o A thread is created to filter specific directory events in a loop, 
      so watch descriptors can be added/removed dynamically
    o Organize all directory watchers as two hashtables and a tree

3.  Usage
---------
    #include "wrap-inotify.h"

    int init_watchers(const char *path, uint32_t mask, int64 size);

        path -> path you want to watch
        mask -> watch mask argument for inotify_add_watch()
        size -> initial hashtable size (approximate subdirectory amount)

	This function return a file descriptor which is readable if something
	detected

    void cleanup_watchers();

        This function cleanup everything.

4.  Contacts
------------
    Author's E-mail: i@lxd.me

5.  About License
-----------------
    sha1.c and sha1.h come from git project, licensed under GPLv2.
    Other code comes from fss project, licensed under GPLv3



About

An extension to original Linux inotify subsystem, mainly implement recursively monitoring.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages