TABLE OF CONTENTS


Hunter/Inotify [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Small Ada binding to kernel inotify

SOURCE

package Inotify is

Inotify/Event_Data [ Types ]

[ Top ] [ Inotify ] [ Types ]

FUNCTION

 Data structure used to store information about inotify event

SOURCE

   type Event_Data is record
      Event: Inotify_Events;
      Target: Unbounded_String;
      Path: Unbounded_String;
   end record;

OPTIONS

 Event  - inotify event
 Target - target file or directory
 Path   - path in which event occurs

Inotify/Events_Container [ Types ]

[ Top ] [ Inotify ] [ Types ]

FUNCTION

 Used to store data about inotify events

SOURCE

   package Events_Container is new Vectors(Positive, Event_Data);

Inotify/Inotify_Events [ Types ]

[ Top ] [ Inotify ] [ Types ]

FUNCTION

 Types of inotify events and values for them

SOURCE

   type Inotify_Events is
     (Accessed, Modified, Metadata, Closed_Write, Closed_No_Write, Opened,
      Moved_From, Moved_To, Created, Deleted, Deleted_Self, Moved_Self,
      Unmounted_Filesystem);

   for Inotify_Events use (Accessed => 16#0001#, Modified => 16#0002#,
      Metadata => 16#0004#, Closed_Write => 16#0008#,
      Closed_No_Write => 16#0010#, Opened => 16#0020#, Moved_From => 16#0040#,
      Moved_To => 16#0080#, Created => 16#0100#, Deleted => 16#0200#,
      Deleted_Self => 16#0400#, Moved_Self => 16#0800#,
      Unmounted_Filesystem => 16#2000#);

Inotify/EventsList [ Variables ]

[ Top ] [ Inotify ] [ Variables ]

FUNCTION

 List of all caught inotify events

SOURCE

   EventsList: Events_Container.Vector;

Inotify/AddWatches [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Add inotify watches for selected path and all subdirectories inside it,
 but not deeper.

SOURCE

   procedure AddWatches(Path: String);

PARAMETERS

 Path - Full path to which inotify watches will be added

Inotify/InotifyClose [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Close inotify instance

SOURCE

   procedure InotifyClose;

Inotify/InotifyInit [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Start inotify instance

SOURCE

   procedure InotifyInit;

Inotify/InotifyRead [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Read all caught and waiting inotify events and store them in EventsList.
 If need, remove and add new watches also.

SOURCE

   procedure InotifyRead;

Inotify/RemoveWatches [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Remove all inotify watches

SOURCE

   procedure RemoveWatches;
>