ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / doc / html / gnome-vfs-gnome-vfs-monitor.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
2 Monitoring</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.0"><meta name="generator" content="GTK-Doc V1.1 (XML mode)"><style type="text/css">
3         .synopsis, .classsynopsis {
4             background: #eeeeee;
5             border: solid 1px #aaaaaa;
6             padding: 0.5em;
7         }
8         .programlisting {
9             background: #eeeeff;
10             border: solid 1px #aaaaff;
11             padding: 0.5em;
12         }
13         .variablelist {
14             padding: 4px;
15             margin-left: 3em;
16         }
17         .navigation {
18             background: #ffeeee;
19             border: solid 1px #ffaaaa;
20             margin-top: 0.5em;
21             margin-bottom: 0.5em;
22         }
23         .navigation a {
24             color: #770000;
25         }
26         .navigation a:visited {
27             color: #550000;
28         }
29         .navigation .title {
30             font-size: 200%;
31         }
32       </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="advanced-operations.html" title="Advanced Operations"><link rel="previous" href="advanced-operations.html" title="Advanced Operations"><link rel="next" href="gnome-vfs-gnome-vfs-cancellation.html" title="
33 Cancellation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="advanced-operations.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="advanced-operations.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th><td><a accesskey="n" href="gnome-vfs-gnome-vfs-cancellation.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="gnome-vfs-gnome-vfs-monitor"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">
34 Monitoring</span></h2><p>
35 Monitoring &#8212; 
36 watch files for changes, and get called back if they do</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
37
38
39
40 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-monitor.html#gnome-vfs-monitor-add">gnome_vfs_monitor_add</a>        (GnomeVFSMonitorHandle **handle,
41                                              const <a
42 href="../glib/glib-Basic-Types.html#gchar"
43 >gchar</a> *text_uri,
44                                              <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorType">GnomeVFSMonitorType</a> monitor_type,
45                                              <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorCallback">GnomeVFSMonitorCallback</a> callback,
46                                              <a
47 href="../glib/glib-Basic-Types.html#gpointer"
48 >gpointer</a> user_data);
49 <a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-gnome-vfs-monitor.html#gnome-vfs-monitor-cancel">gnome_vfs_monitor_cancel</a>     (GnomeVFSMonitorHandle *handle);
50 enum        <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorType">GnomeVFSMonitorType</a>;
51 enum        <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a>;
52 void        (<a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorCallback">*GnomeVFSMonitorCallback</a>)      (GnomeVFSMonitorHandle *handle,
53                                              const <a
54 href="../glib/glib-Basic-Types.html#gchar"
55 >gchar</a> *monitor_uri,
56                                              const <a
57 href="../glib/glib-Basic-Types.html#gchar"
58 >gchar</a> *info_uri,
59                                              <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a> event_type,
60                                              <a
61 href="../glib/glib-Basic-Types.html#gpointer"
62 >gpointer</a> user_data);
63 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
64
65 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="gnome-vfs-monitor-add"></a>gnome_vfs_monitor_add ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_monitor_add        (GnomeVFSMonitorHandle **handle,
66                                              const <a
67 href="../glib/glib-Basic-Types.html#gchar"
68 >gchar</a> *text_uri,
69                                              <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorType">GnomeVFSMonitorType</a> monitor_type,
70                                              <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorCallback">GnomeVFSMonitorCallback</a> callback,
71                                              <a
72 href="../glib/glib-Basic-Types.html#gpointer"
73 >gpointer</a> user_data);</pre><p>
74 Watch the file or directory at <i class="parameter"><tt>text_uri</tt></i> for changes (or the creation/deletion of the file)
75 and call <i class="parameter"><tt>callback</tt></i> when there is a change. If a directory monitor is added, <i class="parameter"><tt>callback</tt></i> is
76 notified when any file in the directory changes.</p><p>
77
78 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle</tt></i> :</span></td><td> after the call, <i class="parameter"><tt>handle</tt></i> will be a pointer to an operation handle
79 </td></tr><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> URI to monitor
80 </td></tr><tr><td><span class="term"><i class="parameter"><tt>monitor_type</tt></i> :</span></td><td> add a directory or file monitor
81 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to call when the monitor is tripped
82 </td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> data to pass to <i class="parameter"><tt>callback</tt></i>
83 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer representing the success of the operation
84 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-monitor-cancel"></a>gnome_vfs_monitor_cancel ()</h3><pre class="programlisting"><a href="gnome-vfs-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_monitor_cancel     (GnomeVFSMonitorHandle *handle);</pre><p>
85 Cancel the monitor pointed to be <i class="parameter"><tt>handle</tt></i>.</p><p>
86
87 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle</tt></i> :</span></td><td> handle of the monitor to cancel
88 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> an integer representing the success of the operation
89 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSMonitorType"></a>enum GnomeVFSMonitorType</h3><pre class="programlisting">typedef enum {
90   GNOME_VFS_MONITOR_FILE,
91   GNOME_VFS_MONITOR_DIRECTORY
92 } GnomeVFSMonitorType;
93 </pre><p>
94 Type of resources that can be monitored.</p><p>
95
96 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSMonitorEventType"></a>enum GnomeVFSMonitorEventType</h3><pre class="programlisting">typedef enum {
97   GNOME_VFS_MONITOR_EVENT_CHANGED,
98   GNOME_VFS_MONITOR_EVENT_DELETED,
99   GNOME_VFS_MONITOR_EVENT_STARTEXECUTING,
100   GNOME_VFS_MONITOR_EVENT_STOPEXECUTING,
101   GNOME_VFS_MONITOR_EVENT_CREATED,
102   GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED
103 } GnomeVFSMonitorEventType;
104 </pre><p>
105 Types of events that can be monitored.</p><p>
106
107 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><tt class="literal">GNOME_VFS_MONITOR_EVENT_CHANGED</tt></span></td><td> file data changed
108 </td></tr><tr><td><span class="term"><tt class="literal">GNOME_VFS_MONITOR_EVENT_DELETED</tt></span></td><td> file deleted event
109 </td></tr><tr><td><span class="term"><tt class="literal">GNOME_VFS_MONITOR_EVENT_STARTEXECUTING</tt></span></td><td>  
110 </td></tr><tr><td><span class="term"><tt class="literal">GNOME_VFS_MONITOR_EVENT_STOPEXECUTING</tt></span></td><td> 
111 </td></tr><tr><td><span class="term"><tt class="literal">GNOME_VFS_MONITOR_EVENT_CREATED</tt></span></td><td> file created event
112 </td></tr><tr><td><span class="term"><tt class="literal">GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED</tt></span></td><td> file metadata changed
113 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSMonitorCallback"></a>GnomeVFSMonitorCallback ()</h3><pre class="programlisting">void        (*GnomeVFSMonitorCallback)      (GnomeVFSMonitorHandle *handle,
114                                              const <a
115 href="../glib/glib-Basic-Types.html#gchar"
116 >gchar</a> *monitor_uri,
117                                              const <a
118 href="../glib/glib-Basic-Types.html#gchar"
119 >gchar</a> *info_uri,
120                                              <a href="gnome-vfs-gnome-vfs-monitor.html#GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a> event_type,
121                                              <a
122 href="../glib/glib-Basic-Types.html#gpointer"
123 >gpointer</a> user_data);</pre><p>
124 Function called when a monitor detects a change.</p><p>
125
126 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle</tt></i> :</span></td><td> the handle of the monitor that created the event
127 </td></tr><tr><td><span class="term"><i class="parameter"><tt>monitor_uri</tt></i> :</span></td><td> the URI of the monitor that was triggered
128 </td></tr><tr><td><span class="term"><i class="parameter"><tt>info_uri</tt></i> :</span></td><td> the URI of the actual file this event is concerned with (this can be different
129 from <i class="parameter"><tt>monitor_uri</tt></i> if it was a directory monitor)
130 </td></tr><tr><td><span class="term"><i class="parameter"><tt>event_type</tt></i> :</span></td><td> what happened to <i class="parameter"><tt>info_uri</tt></i>
131 </td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> user data passed to <a href="gnome-vfs-gnome-vfs-monitor.html#gnome-vfs-monitor-add">gnome_vfs_monitor_add</a>() when the monitor was created
132 </td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="advanced-operations.html"><b>&lt;&lt; Advanced Operations</b></a></td><td align="right"><a accesskey="n" href="gnome-vfs-gnome-vfs-cancellation.html"><b>
133 Cancellation &gt;&gt;</b></a></td></tr></table></body></html>