Subversion Repositories public

Rev

Rev 47 | Rev 57 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 47 Rev 55
Line 20... Line 20...
20
rather than time periods.
20
rather than time periods.
21
21
22
2. Requirements
22
2. Requirements
23
* Linux kernel 2.6.13 or later (with inotify compiled in)
23
* Linux kernel 2.6.13 or later (with inotify compiled in)
24
* inotify headers (inotify.h, inotify-syscalls.h) installed in
24
* inotify headers (inotify.h, sometimes inotify-syscalls.h) installed in
25
  <INCLUDE_DIR>/sys. The most common place is /usr/include/sys.
25
  <INCLUDE_DIR>/sys. The most common place is /usr/include/sys.
26
* GCC 4.x compiler (probably works also with GCC 3.4, possibly with
26
* GCC 4.x compiler (probably works also with GCC 3.4, possibly with
27
  older versions too)
27
  older versions too)
28
28
29
  
29
  
30
3. How to build
30
3. How to build
Line 66... Line 66...
66
66
67
  $$ - a dollar sign
67
  $$ - a dollar sign
68
  $@ - the watched filesystem path (see above)
68
  $@ - the watched filesystem path (see above)
69
  $# - the event-related file name
69
  $# - the event-related file name
70
70
  $% - the event flags (textually)
-
 
71
  $& - the event flags (numerically)
-
 
72
71
The mask may additionaly contain a special symbol IN_NO_LOOP which
73
The mask may additionaly contain a special symbol IN_NO_LOOP which
72
disables events occurred during the event handling (to avoid loops).
74
disables events occurred during the event handling (to avoid loops).
73
75
74
Example: You need to run program 'abc' with the full file path as
76
Example 1: You need to run program 'abc' with the full file path as
75
an argument every time a file is changed in /var/mail. One of
77
an argument every time a file is changed in /var/mail. One of
76
the solutions follows:
78
the solutions follows:
77
79
78
/var/mail IN_CLOSE_WRITE abc $@/$#
80
/var/mail IN_CLOSE_WRITE abc $@/$#
79
81
80
82
Example 2: You need to run program 'efg' with the full file path as
-
 
83
the first argument and the numeric event flags as the second one.
-
 
84
It have to monitor all events on files in /tmp. Here is it:
-
 
85
-
 
86
/tmp IN_ALL_EVENTS efg $@/$# $&
-
 
87
-
 
88
81
5. Bugs, suggestions
89
5. Bugs, suggestions
82
THIS PROGRAM IS AN ALPHA VERSION. IT PROBABLY CONTAINS BUGS AND
90
THIS PROGRAM IS AN ALPHA VERSION. IT PROBABLY CONTAINS BUGS AND
83
THEREFORE IT IS NOT INTENDED FOR PRODUCTION USE.
91
THEREFORE IT IS NOT INTENDED FOR PRODUCTION USE.
84
92
85
If you find a bug or have a suggestion how to improve the program,
93
If you find a bug or have a suggestion how to improve the program,