~ubuntu-branches/ubuntu/natty/gnome-vfs/natty

« back to all changes in this revision

Viewing changes to doc/html/gnome-vfs-2.0-gnome-vfs-monitor.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-03-17 16:12:58 UTC
  • mfrom: (0.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090317161258-px3a2czt9g2ktjz3
Tags: 1:2.24.1-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>Monitoring</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
 
7
<link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library">
 
8
<link rel="up" href="gnome-vfs-file-and-dirs-ops.html" title="Advanced File/Directory Operations">
 
9
<link rel="prev" href="gnome-vfs-2.0-gnome-vfs-xfer.html" title="File Transfers">
 
10
<link rel="next" href="gnome-vfs-2.0-gnome-vfs-file-advanced-ops.html" title="Backend-Specific Operations">
 
11
<meta name="generator" content="GTK-Doc V1.12 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
<link rel="chapter" href="about.html" title="Introduction to GnomeVFS">
 
14
<link rel="chapter" href="data-types.html" title="Basic Data Types">
 
15
<link rel="chapter" href="gnome-vfs-basic-file-ops.html" title="File Operations">
 
16
<link rel="chapter" href="gnome-vfs-directory-ops.html" title="Directory-Specific Operations">
 
17
<link rel="chapter" href="gnome-vfs-file-and-dirs-ops.html" title="Advanced File/Directory Operations">
 
18
<link rel="chapter" href="gnome-vfs-file-async-ops.html" title="Asynchronous Operations">
 
19
<link rel="chapter" href="volumes.html" title="Volumes and Drives Handling">
 
20
<link rel="chapter" href="networking.html" title="Networking">
 
21
<link rel="chapter" href="mime-registry.html" title="MIME Registry">
 
22
<link rel="chapter" href="modules.html" title="Filesystem Modules">
 
23
</head>
 
24
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
25
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
26
<tr valign="middle">
 
27
<td><a accesskey="p" href="gnome-vfs-2.0-gnome-vfs-xfer.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
28
<td><a accesskey="u" href="gnome-vfs-file-and-dirs-ops.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
29
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
30
<th width="100%" align="center">GnomeVFS - Filesystem Abstraction library</th>
 
31
<td><a accesskey="n" href="gnome-vfs-2.0-gnome-vfs-file-advanced-ops.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
32
</tr>
 
33
<tr><td colspan="5" class="shortcuts">
 
34
<a href="#gnome-vfs-2.0-gnome-vfs-monitor.synopsis" class="shortcut">Top</a>
 
35
                   | 
 
36
                  <a href="#gnome-vfs-2.0-gnome-vfs-monitor.description" class="shortcut">Description</a>
 
37
</td></tr>
 
38
</table>
 
39
<div class="refentry" lang="en">
 
40
<a name="gnome-vfs-2.0-gnome-vfs-monitor"></a><div class="titlepage"></div>
 
41
<div class="refnamediv"><table width="100%"><tr>
 
42
<td valign="top">
 
43
<h2><span class="refentrytitle"><a name="gnome-vfs-2.0-gnome-vfs-monitor.top_of_page"></a>Monitoring</span></h2>
 
44
<p>Monitoring — watch files for changes, and get called back if they do</p>
 
45
</td>
 
46
<td valign="top" align="right"></td>
 
47
</tr></table></div>
 
48
<div class="refsynopsisdiv">
 
49
<a name="gnome-vfs-2.0-gnome-vfs-monitor.synopsis"></a><h2>Synopsis</h2>
 
50
<pre class="synopsis">
 
51
typedef             <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorHandle" title="GnomeVFSMonitorHandle">GnomeVFSMonitorHandle</a>;
 
52
enum                <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorType" title="enum GnomeVFSMonitorType">GnomeVFSMonitorType</a>;
 
53
enum                <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorEventType" title="enum GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a>;
 
54
void                (<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorCallback" title="GnomeVFSMonitorCallback ()">*GnomeVFSMonitorCallback</a>)          (<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorHandle" title="GnomeVFSMonitorHandle">GnomeVFSMonitorHandle</a> *handle,
 
55
                                                         const gchar *monitor_uri,
 
56
                                                         const gchar *info_uri,
 
57
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorEventType" title="enum GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a> event_type,
 
58
                                                         gpointer user_data);
 
59
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a>      <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-add" title="gnome_vfs_monitor_add ()">gnome_vfs_monitor_add</a>               (<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorHandle" title="GnomeVFSMonitorHandle">GnomeVFSMonitorHandle</a> **handle,
 
60
                                                         const gchar *text_uri,
 
61
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorType" title="enum GnomeVFSMonitorType">GnomeVFSMonitorType</a> monitor_type,
 
62
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorCallback" title="GnomeVFSMonitorCallback ()">GnomeVFSMonitorCallback</a> callback,
 
63
                                                         gpointer user_data);
 
64
<a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a>      <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-cancel" title="gnome_vfs_monitor_cancel ()">gnome_vfs_monitor_cancel</a>            (<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorHandle" title="GnomeVFSMonitorHandle">GnomeVFSMonitorHandle</a> *handle);
 
65
void                <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-callback" title="gnome_vfs_monitor_callback ()">gnome_vfs_monitor_callback</a>          (GnomeVFSMethodHandle *method_handle,
 
66
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *info_uri,
 
67
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorEventType" title="enum GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a> event_type);
 
68
</pre>
 
69
</div>
 
70
<div class="refsect1" lang="en">
 
71
<a name="gnome-vfs-2.0-gnome-vfs-monitor.description"></a><h2>Description</h2>
 
72
<p>
 
73
</p>
 
74
</div>
 
75
<div class="refsect1" lang="en">
 
76
<a name="gnome-vfs-2.0-gnome-vfs-monitor.details"></a><h2>Details</h2>
 
77
<div class="refsect2" lang="en">
 
78
<a name="GnomeVFSMonitorHandle"></a><h3>GnomeVFSMonitorHandle</h3>
 
79
<pre class="programlisting">typedef struct GnomeVFSMonitorHandle GnomeVFSMonitorHandle;
 
80
</pre>
 
81
<p>
 
82
a handle representing a file or directory monitor that
 
83
was registered using <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-add" title="gnome_vfs_monitor_add ()"><code class="function">gnome_vfs_monitor_add()</code></a> and that
 
84
can be cancelled using <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-cancel" title="gnome_vfs_monitor_cancel ()"><code class="function">gnome_vfs_monitor_cancel()</code></a>.</p>
 
85
<p>
 
86
</p>
 
87
</div>
 
88
<hr>
 
89
<div class="refsect2" lang="en">
 
90
<a name="GnomeVFSMonitorType"></a><h3>enum GnomeVFSMonitorType</h3>
 
91
<pre class="programlisting">typedef enum {
 
92
  GNOME_VFS_MONITOR_FILE,
 
93
  GNOME_VFS_MONITOR_DIRECTORY
 
94
} GnomeVFSMonitorType;
 
95
</pre>
 
96
<p>
 
97
Type of resources that can be monitored.</p>
 
98
<p>
 
99
</p>
 
100
<div class="variablelist"><table border="0">
 
101
<col align="left" valign="top">
 
102
<tbody>
 
103
<tr>
 
104
<td><p><a name="GNOME-VFS-MONITOR-FILE:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_FILE</code></span></p></td>
 
105
<td> the monitor is registered for a single file.
 
106
</td>
 
107
</tr>
 
108
<tr>
 
109
<td><p><a name="GNOME-VFS-MONITOR-DIRECTORY:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_DIRECTORY</code></span></p></td>
 
110
<td> the monitor is registered for all files in a directory,
 
111
                                 and the directory itself.
 
112
</td>
 
113
</tr>
 
114
</tbody>
 
115
</table></div>
 
116
</div>
 
117
<hr>
 
118
<div class="refsect2" lang="en">
 
119
<a name="GnomeVFSMonitorEventType"></a><h3>enum GnomeVFSMonitorEventType</h3>
 
120
<pre class="programlisting">typedef enum {
 
121
  GNOME_VFS_MONITOR_EVENT_CHANGED,
 
122
  GNOME_VFS_MONITOR_EVENT_DELETED,
 
123
  GNOME_VFS_MONITOR_EVENT_STARTEXECUTING,
 
124
  GNOME_VFS_MONITOR_EVENT_STOPEXECUTING,
 
125
  GNOME_VFS_MONITOR_EVENT_CREATED,
 
126
  GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED
 
127
} GnomeVFSMonitorEventType;
 
128
</pre>
 
129
<p>
 
130
Types of events that can be monitored.</p>
 
131
<p>
 
132
</p>
 
133
<div class="variablelist"><table border="0">
 
134
<col align="left" valign="top">
 
135
<tbody>
 
136
<tr>
 
137
<td><p><a name="GNOME-VFS-MONITOR-EVENT-CHANGED:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_EVENT_CHANGED</code></span></p></td>
 
138
<td> file data changed (FAM, inotify).
 
139
</td>
 
140
</tr>
 
141
<tr>
 
142
<td><p><a name="GNOME-VFS-MONITOR-EVENT-DELETED:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_EVENT_DELETED</code></span></p></td>
 
143
<td> file deleted event (FAM, inotify).
 
144
</td>
 
145
</tr>
 
146
<tr>
 
147
<td><p><a name="GNOME-VFS-MONITOR-EVENT-STARTEXECUTING:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_EVENT_STARTEXECUTING</code></span></p></td>
 
148
<td> file was executed (FAM only).
 
149
</td>
 
150
</tr>
 
151
<tr>
 
152
<td><p><a name="GNOME-VFS-MONITOR-EVENT-STOPEXECUTING:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_EVENT_STOPEXECUTING</code></span></p></td>
 
153
<td> executed file isn't executed anymore (FAM only).
 
154
</td>
 
155
</tr>
 
156
<tr>
 
157
<td><p><a name="GNOME-VFS-MONITOR-EVENT-CREATED:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_EVENT_CREATED</code></span></p></td>
 
158
<td> file created event (FAM, inotify).
 
159
</td>
 
160
</tr>
 
161
<tr>
 
162
<td><p><a name="GNOME-VFS-MONITOR-EVENT-METADATA-CHANGED:CAPS"></a><span class="term"><code class="literal">GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED</code></span></p></td>
 
163
<td> file metadata changed (inotify only).
 
164
</td>
 
165
</tr>
 
166
</tbody>
 
167
</table></div>
 
168
</div>
 
169
<hr>
 
170
<div class="refsect2" lang="en">
 
171
<a name="GnomeVFSMonitorCallback"></a><h3>GnomeVFSMonitorCallback ()</h3>
 
172
<pre class="programlisting">void                (*GnomeVFSMonitorCallback)          (<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorHandle" title="GnomeVFSMonitorHandle">GnomeVFSMonitorHandle</a> *handle,
 
173
                                                         const gchar *monitor_uri,
 
174
                                                         const gchar *info_uri,
 
175
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorEventType" title="enum GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a> event_type,
 
176
                                                         gpointer user_data);</pre>
 
177
<p>
 
178
Function called when a monitor detects a change.</p>
 
179
<p>
 
180
</p>
 
181
<div class="variablelist"><table border="0">
 
182
<col align="left" valign="top">
 
183
<tbody>
 
184
<tr>
 
185
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
 
186
<td> the handle of the monitor that created the event
 
187
</td>
 
188
</tr>
 
189
<tr>
 
190
<td><p><span class="term"><em class="parameter"><code>monitor_uri</code></em> :</span></p></td>
 
191
<td> the URI of the monitor that was triggered
 
192
</td>
 
193
</tr>
 
194
<tr>
 
195
<td><p><span class="term"><em class="parameter"><code>info_uri</code></em> :</span></p></td>
 
196
<td> the URI of the actual file this event is concerned with (this can be different
 
197
from <em class="parameter"><code>monitor_uri</code></em> if it was a directory monitor)
 
198
</td>
 
199
</tr>
 
200
<tr>
 
201
<td><p><span class="term"><em class="parameter"><code>event_type</code></em> :</span></p></td>
 
202
<td> what happened to <em class="parameter"><code>info_uri</code></em>
 
203
</td>
 
204
</tr>
 
205
<tr>
 
206
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
 
207
<td> user data passed to <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-add" title="gnome_vfs_monitor_add ()"><code class="function">gnome_vfs_monitor_add()</code></a> when the monitor was created
 
208
</td>
 
209
</tr>
 
210
</tbody>
 
211
</table></div>
 
212
</div>
 
213
<hr>
 
214
<div class="refsect2" lang="en">
 
215
<a name="gnome-vfs-monitor-add"></a><h3>gnome_vfs_monitor_add ()</h3>
 
216
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a>      gnome_vfs_monitor_add               (<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorHandle" title="GnomeVFSMonitorHandle">GnomeVFSMonitorHandle</a> **handle,
 
217
                                                         const gchar *text_uri,
 
218
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorType" title="enum GnomeVFSMonitorType">GnomeVFSMonitorType</a> monitor_type,
 
219
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorCallback" title="GnomeVFSMonitorCallback ()">GnomeVFSMonitorCallback</a> callback,
 
220
                                                         gpointer user_data);</pre>
 
221
<p>
 
222
Watch the file or directory at <em class="parameter"><code>text_uri</code></em> for changes (or the creation/deletion of the file)
 
223
and call <em class="parameter"><code>callback</code></em> when there is a change. If a directory monitor is added, <em class="parameter"><code>callback</code></em> is
 
224
notified when any file in the directory changes.</p>
 
225
<p>
 
226
</p>
 
227
<div class="variablelist"><table border="0">
 
228
<col align="left" valign="top">
 
229
<tbody>
 
230
<tr>
 
231
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
 
232
<td> after the call, <em class="parameter"><code>handle</code></em> will be a pointer to an operation handle.
 
233
</td>
 
234
</tr>
 
235
<tr>
 
236
<td><p><span class="term"><em class="parameter"><code>text_uri</code></em> :</span></p></td>
 
237
<td> string representing the uri to monitor.
 
238
</td>
 
239
</tr>
 
240
<tr>
 
241
<td><p><span class="term"><em class="parameter"><code>monitor_type</code></em> :</span></p></td>
 
242
<td> add a directory or file monitor.
 
243
</td>
 
244
</tr>
 
245
<tr>
 
246
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
 
247
<td> function to call when the monitor is tripped.
 
248
</td>
 
249
</tr>
 
250
<tr>
 
251
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
 
252
<td> data to pass to <em class="parameter"><code>callback</code></em>.
 
253
</td>
 
254
</tr>
 
255
<tr>
 
256
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
257
<td> an integer representing the result of the operation.
 
258
</td>
 
259
</tr>
 
260
</tbody>
 
261
</table></div>
 
262
</div>
 
263
<hr>
 
264
<div class="refsect2" lang="en">
 
265
<a name="gnome-vfs-monitor-cancel"></a><h3>gnome_vfs_monitor_cancel ()</h3>
 
266
<pre class="programlisting"><a class="link" href="gnome-vfs-2.0-gnome-vfs-result.html#GnomeVFSResult" title="enum GnomeVFSResult">GnomeVFSResult</a>      gnome_vfs_monitor_cancel            (<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorHandle" title="GnomeVFSMonitorHandle">GnomeVFSMonitorHandle</a> *handle);</pre>
 
267
<p>
 
268
Cancel the monitor pointed to be <em class="parameter"><code>handle</code></em>.</p>
 
269
<p>
 
270
</p>
 
271
<div class="variablelist"><table border="0">
 
272
<col align="left" valign="top">
 
273
<tbody>
 
274
<tr>
 
275
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
 
276
<td> handle of the monitor to cancel.
 
277
</td>
 
278
</tr>
 
279
<tr>
 
280
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
281
<td> an integer representing the result of the operation.
 
282
</td>
 
283
</tr>
 
284
</tbody>
 
285
</table></div>
 
286
</div>
 
287
<hr>
 
288
<div class="refsect2" lang="en">
 
289
<a name="gnome-vfs-monitor-callback"></a><h3>gnome_vfs_monitor_callback ()</h3>
 
290
<pre class="programlisting">void                gnome_vfs_monitor_callback          (GnomeVFSMethodHandle *method_handle,
 
291
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-uri.html#GnomeVFSURI" title="GnomeVFSURI">GnomeVFSURI</a> *info_uri,
 
292
                                                         <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorEventType" title="enum GnomeVFSMonitorEventType">GnomeVFSMonitorEventType</a> event_type);</pre>
 
293
<p>
 
294
<a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-callback" title="gnome_vfs_monitor_callback ()"><code class="function">gnome_vfs_monitor_callback()</code></a> is used by <span class="type">GnomeVFSMethods</span> to indicate that a particular
 
295
resource changed, and will issue the emission of the <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#GnomeVFSMonitorCallback" title="GnomeVFSMonitorCallback ()"><span class="type">GnomeVFSMonitorCallback</span></a> registered
 
296
using <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-add" title="gnome_vfs_monitor_add ()"><code class="function">gnome_vfs_monitor_add()</code></a>.</p>
 
297
<p>
 
298
</p>
 
299
<div class="variablelist"><table border="0">
 
300
<col align="left" valign="top">
 
301
<tbody>
 
302
<tr>
 
303
<td><p><span class="term"><em class="parameter"><code>method_handle</code></em> :</span></p></td>
 
304
<td> Method-specific monitor handle obtained through <a class="link" href="gnome-vfs-2.0-gnome-vfs-monitor.html#gnome-vfs-monitor-add" title="gnome_vfs_monitor_add ()"><code class="function">gnome_vfs_monitor_add()</code></a>.
 
305
</td>
 
306
</tr>
 
307
<tr>
 
308
<td><p><span class="term"><em class="parameter"><code>info_uri</code></em> :</span></p></td>
 
309
<td> URI that triggered the callback.
 
310
</td>
 
311
</tr>
 
312
<tr>
 
313
<td><p><span class="term"><em class="parameter"><code>event_type</code></em> :</span></p></td>
 
314
<td> The event obtained for <em class="parameter"><code>info_uri</code></em>.
 
315
</td>
 
316
</tr>
 
317
</tbody>
 
318
</table></div>
 
319
</div>
 
320
</div>
 
321
</div>
 
322
<div class="footer">
 
323
<hr>
 
324
          Generated by GTK-Doc V1.12</div>
 
325
</body>
 
326
</html>