| 1 | .\" -*-nroff-*- |
| 2 | .TH fwatch 3 "3 February 2001" "Straylight/Edgeware" "mLib utilities library" |
| 3 | .SH NAME |
| 4 | fwatch \- watch a file for changes |
| 5 | .\" @fwatch_init |
| 6 | .\" @fwatch_initfd |
| 7 | .\" @fwatch_update |
| 8 | .\" @fwatch_updatefd |
| 9 | .SH SYNOPSIS |
| 10 | .nf |
| 11 | .B "#include <mLib/fwatch.h>" |
| 12 | |
| 13 | .B "typedef struct { ...\& } fwatch;" |
| 14 | |
| 15 | .BI "void fwatch_init(fwatch *" f ", const char *" name ); |
| 16 | .BI "void fwatch_initfd(fwatch *" f ", int " fd ); |
| 17 | .BI "int fwatch_update(fwatch *" f ", const char *" name ); |
| 18 | .BI "int fwatch_updatefd(fwatch *" f ", int " fd ); |
| 19 | .fi |
| 20 | .SH DESCRIPTION |
| 21 | These functions watch a file for changes. Use |
| 22 | .B fwatch_init |
| 23 | or |
| 24 | .B fwatch_initfd |
| 25 | to initialize a |
| 26 | .B fwatch |
| 27 | block with information about a file; then later, the functions |
| 28 | .B fwatch_update |
| 29 | and |
| 30 | .B fwatch_updatefd |
| 31 | will update the information in the structure and inform you whether the |
| 32 | file changed. |
| 33 | .PP |
| 34 | The |
| 35 | .B fwatch |
| 36 | functions can't return errors: they remember errors as part of the file |
| 37 | state instead. The |
| 38 | .B update |
| 39 | functions return zero if the file has not changed or nonzero if it has. |
| 40 | .SH SEE ALSO |
| 41 | .BR mLib (3). |
| 42 | .SH AUTHOR |
| 43 | Mark Wooding, <mdw@distorted.org.uk> |