chiark / gitweb /
Import buf from Catacomb; split out the dstr bits, and throw away the mp and
[mLib] / man / fwatch.3
CommitLineData
32e1147e 1.\" -*-nroff-*-
fbf20b5b 2.TH fwatch 3 "3 February 2001" "Straylight/Edgeware" "mLib utilities library"
32e1147e 3.SH NAME
4fwatch \- 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.BI "void fwatch_init(fwatch *" f ", const char *" name );
14.BI "void fwatch_initfd(fwatch *" f ", int " fd );
15.BI "int fwatch_update(fwatch *" f ", const char *" name );
16.BI "int fwatch_updatefd(fwatch *" f ", int " fd );
17.fi
18.SH DESCRIPTION
19These functions watch a file for changes. Use
20.B fwatch_init
21or
22.B fwatch_initfd
23to initialize a
24.B fwatch
25block with information about a file; then later, the functions
26.B fwatch_update
27and
28.B fwatch_updatefd
29will update the information in the structure and inform you whether the
30file changed.
31.PP
32The
33.B fwatch
34functions can't return errors: they remember errors as part of the file
35state instead. The
36.B update
37functions return zero if the file has not changed or nonzero if it has.
38.SH SEE ALSO
39.BR mLib (3).
40.SH AUTHOR
9b5ac6ff 41Mark Wooding, <mdw@distorted.org.uk>