TABLE OF CONTENTS


Inotify/Mask_Array [ Types ]

[ Top ] [ Inotify ] [ Types ]

FUNCTION

 Array of inotify events to catch

SOURCE

   type Mask_Array is array(Positive range <>) of Inotify_Events;

Inotify/Watch_Data [ Types ]

[ Top ] [ Inotify ] [ Types ]

FUNCTION

 Data structure for inotify watches

SOURCE

   type Watch_Data is record
      Id: int;
      Path: Unbounded_String;
   end record;

OPTIONS

 Id   - Id of the inotify watch
 Path - Full path which the inotify watch is watching

Inotify/Watches_Container [ Types ]

[ Top ] [ Inotify ] [ Types ]

FUNCTION

 Used to store information about inotify watches

SOURCE

   package Watches_Container is new Vectors(Positive, Watch_Data);

Inotify/Instance [ Variables ]

[ Top ] [ Inotify ] [ Variables ]

FUNCTION

 inotify instance to read

SOURCE

   Instance: File_Descriptor;

Inotify/Watches [ Variables ]

[ Top ] [ Inotify ] [ Variables ]

FUNCTION

 Stores information about all active inotify watches

SOURCE

   Watches: Watches_Container.Vector;

Inotify/AddWatch [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Add inotify watch to selected path

SOURCE

   procedure AddWatch(Path: String) is

PARAMETERS

 Path - Full path to which new inotify watch will be added

Inotify/CreateMask [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Convert list of inotify events to mask value for C

SOURCE

   function CreateMask(Events: Mask_Array) return int is

PARAMETERS

 Events - list of inotify events to convert

RESULT

 Mask value for C

Inotify/inotify_add_watch [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Binding to the C function

SOURCE

   function inotify_add_watch
     (fd: int; pathname: chars_ptr; mask: int) return int with
      Import => True,
      Convention => C,
      External_Name => "inotify_add_watch";

PARAMETERS

 fd       - inotify instance to which add a new watch
 pathname - full path to which a new inotify watch will be added
 mask     - list of inotify events to listen

RESULT

 -1 if inotify watch cannot be added, 0 if exists, otherwise index of
 newly created watch

Inotify/inotify_init [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Binding to the C function

SOURCE

   function inotify_init return int with
      Import => True,
      Convention => C,
      External_Name => "inotify_init";

RESULT

 File descriptor used for a newly created inotify instance

Inotify/inotify_rm_watch [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Binding to the C function

SOURCE

   function inotify_rm_watch(fd, wd: int) return int with
      Import => True,
      Convention => C,
      External_Name => "inotify_rm_watch";

PARAMETERS

 fd - inotify instance from which selected watch will be removed
 wd - inotify watch index to remove

RESULT

 0 if inotify watch was succesfully removed, -1 when error occurs

Inotify/RemoveWatch [ Subprograms ]

[ Top ] [ Inotify ] [ Subprograms ]

FUNCTION

 Remove selected watch

SOURCE

   procedure RemoveWatch(Path: String) is

PARAMETERS

 Path - Full path from which inotify watch will be removed
>