1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Asynchronous File Operations</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">
2 .synopsis, .classsynopsis {
4 border: solid 1px #aaaaaa;
9 border: solid 1px #aaaaff;
18 border: solid 1px #ffaaaa;
25 .navigation a:visited {
31 </style><link rel="home" href="index.html" title="GnomeVFS - Filesystem Abstraction library"><link rel="up" href="gnome-vfs-file-operations.html" title="File Handling"><link rel="previous" href="gnome-vfs-20-gnome-vfs-file-advanced-ops.html" title="Advanced File Operations"><link rel="next" href="advanced-operations.html" title="Advanced Operations"></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="gnome-vfs-20-gnome-vfs-file-advanced-ops.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="gnome-vfs-file-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="advanced-operations.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-20-gnome-vfs-async-ops"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Asynchronous File Operations</span></h2><p>Asynchronous File Operations —
32 POSIX-style file operations that run outside your main loop</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
36 #define <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GNOME-VFS-PRIORITY-MIN-CAPS">GNOME_VFS_PRIORITY_MIN</a>
37 #define <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GNOME-VFS-PRIORITY-MAX-CAPS">GNOME_VFS_PRIORITY_MAX</a>
38 #define <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GNOME-VFS-PRIORITY-DEFAULT-CAPS">GNOME_VFS_PRIORITY_DEFAULT</a>
39 void (<a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCallback">*GnomeVFSAsyncCallback</a>) (GnomeVFSAsyncHandle *handle,
40 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> result,
42 href="../glib/glib-Basic-Types.html#gpointer"
43 >gpointer</a> callback_data);
44 typedef <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a>;
45 typedef <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCreateCallback">GnomeVFSAsyncCreateCallback</a>;
46 typedef <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCreateAsChannelCallback">GnomeVFSAsyncCreateAsChannelCallback</a>;
47 typedef <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCloseCallback">GnomeVFSAsyncCloseCallback</a>;
48 void (<a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncReadCallback">*GnomeVFSAsyncReadCallback</a>) (GnomeVFSAsyncHandle *handle,
49 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> result,
51 href="../glib/glib-Basic-Types.html#gpointer"
53 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_requested,
54 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_read,
56 href="../glib/glib-Basic-Types.html#gpointer"
57 >gpointer</a> callback_data);
58 void (<a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncWriteCallback">*GnomeVFSAsyncWriteCallback</a>) (GnomeVFSAsyncHandle *handle,
59 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> result,
61 href="../glib/glib-Basic-Types.html#gconstpointer"
62 >gconstpointer</a> buffer,
63 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_requested,
64 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_written,
66 href="../glib/glib-Basic-Types.html#gpointer"
67 >gpointer</a> callback_data);
68 typedef <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSFindDirectoryResult">GnomeVFSFindDirectoryResult</a>;
69 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-set-job-limit">gnome_vfs_async_set_job_limit</a> (int limit);
70 int <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-get-job-limit">gnome_vfs_async_get_job_limit</a> (void);
71 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-cancel">gnome_vfs_async_cancel</a> (GnomeVFSAsyncHandle *handle);
72 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-open">gnome_vfs_async_open</a> (GnomeVFSAsyncHandle **handle_return,
74 href="../glib/glib-Basic-Types.html#gchar"
76 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
78 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
80 href="../glib/glib-Basic-Types.html#gpointer"
81 >gpointer</a> callback_data);
82 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-open-uri">gnome_vfs_async_open_uri</a> (GnomeVFSAsyncHandle **handle_return,
84 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
86 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
88 href="../glib/glib-Basic-Types.html#gpointer"
89 >gpointer</a> callback_data);
90 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-open-as-channel">gnome_vfs_async_open_as_channel</a> (GnomeVFSAsyncHandle **handle_return,
92 href="../glib/glib-Basic-Types.html#gchar"
94 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
96 href="../glib/glib-Basic-Types.html#guint"
97 >guint</a> advised_block_size,
99 GnomeVFSAsyncOpenAsChannelCallback callback,
101 href="../glib/glib-Basic-Types.html#gpointer"
102 >gpointer</a> callback_data);
103 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-open-uri-as-channel">gnome_vfs_async_open_uri_as_channel</a>
104 (GnomeVFSAsyncHandle **handle_return,
106 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
108 href="../glib/glib-Basic-Types.html#guint"
109 >guint</a> advised_block_size,
111 GnomeVFSAsyncOpenAsChannelCallback callback,
113 href="../glib/glib-Basic-Types.html#gpointer"
114 >gpointer</a> callback_data);
115 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-create">gnome_vfs_async_create</a> (GnomeVFSAsyncHandle **handle_return,
117 href="../glib/glib-Basic-Types.html#gchar"
118 >gchar</a> *text_uri,
119 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
121 href="../glib/glib-Basic-Types.html#gboolean"
122 >gboolean</a> exclusive,
124 href="../glib/glib-Basic-Types.html#guint"
127 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
129 href="../glib/glib-Basic-Types.html#gpointer"
130 >gpointer</a> callback_data);
131 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-create-uri">gnome_vfs_async_create_uri</a> (GnomeVFSAsyncHandle **handle_return,
133 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
135 href="../glib/glib-Basic-Types.html#gboolean"
136 >gboolean</a> exclusive,
138 href="../glib/glib-Basic-Types.html#guint"
141 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
143 href="../glib/glib-Basic-Types.html#gpointer"
144 >gpointer</a> callback_data);
145 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-create-symbolic-link">gnome_vfs_async_create_symbolic_link</a>
146 (GnomeVFSAsyncHandle **handle_return,
149 href="../glib/glib-Basic-Types.html#gchar"
150 >gchar</a> *uri_reference,
152 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
154 href="../glib/glib-Basic-Types.html#gpointer"
155 >gpointer</a> callback_data);
156 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-create-as-channel">gnome_vfs_async_create_as_channel</a>
157 (GnomeVFSAsyncHandle **handle_return,
159 href="../glib/glib-Basic-Types.html#gchar"
160 >gchar</a> *text_uri,
161 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
163 href="../glib/glib-Basic-Types.html#gboolean"
164 >gboolean</a> exclusive,
166 href="../glib/glib-Basic-Types.html#guint"
169 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCreateAsChannelCallback">GnomeVFSAsyncCreateAsChannelCallback</a> callback,
171 href="../glib/glib-Basic-Types.html#gpointer"
172 >gpointer</a> callback_data);
173 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-create-uri-as-channel">gnome_vfs_async_create_uri_as_channel</a>
174 (GnomeVFSAsyncHandle **handle_return,
176 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
178 href="../glib/glib-Basic-Types.html#gboolean"
179 >gboolean</a> exclusive,
181 href="../glib/glib-Basic-Types.html#guint"
184 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCreateAsChannelCallback">GnomeVFSAsyncCreateAsChannelCallback</a> callback,
186 href="../glib/glib-Basic-Types.html#gpointer"
187 >gpointer</a> callback_data);
188 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-close">gnome_vfs_async_close</a> (GnomeVFSAsyncHandle *handle,
189 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCloseCallback">GnomeVFSAsyncCloseCallback</a> callback,
191 href="../glib/glib-Basic-Types.html#gpointer"
192 >gpointer</a> callback_data);
193 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-read">gnome_vfs_async_read</a> (GnomeVFSAsyncHandle *handle,
195 href="../glib/glib-Basic-Types.html#gpointer"
196 >gpointer</a> buffer,
198 href="../glib/glib-Basic-Types.html#guint"
200 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncReadCallback">GnomeVFSAsyncReadCallback</a> callback,
202 href="../glib/glib-Basic-Types.html#gpointer"
203 >gpointer</a> callback_data);
204 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-write">gnome_vfs_async_write</a> (GnomeVFSAsyncHandle *handle,
206 href="../glib/glib-Basic-Types.html#gconstpointer"
207 >gconstpointer</a> buffer,
209 href="../glib/glib-Basic-Types.html#guint"
211 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncWriteCallback">GnomeVFSAsyncWriteCallback</a> callback,
213 href="../glib/glib-Basic-Types.html#gpointer"
214 >gpointer</a> callback_data);
215 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-get-file-info">gnome_vfs_async_get_file_info</a> (GnomeVFSAsyncHandle **handle_return,
217 href="../glib/glib-Doubly-Linked-Lists.html#GList"
218 >GList</a> *uri_list,
219 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
221 GnomeVFSAsyncGetFileInfoCallback callback,
223 href="../glib/glib-Basic-Types.html#gpointer"
224 >gpointer</a> callback_data);
225 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-set-file-info">gnome_vfs_async_set_file_info</a> (GnomeVFSAsyncHandle **handle_return,
227 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
228 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask,
229 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
231 GnomeVFSAsyncSetFileInfoCallback callback,
233 href="../glib/glib-Basic-Types.html#gpointer"
234 >gpointer</a> callback_data);
235 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-load-directory">gnome_vfs_async_load_directory</a> (GnomeVFSAsyncHandle **handle_return,
237 href="../glib/glib-Basic-Types.html#gchar"
238 >gchar</a> *text_uri,
239 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
241 href="../glib/glib-Basic-Types.html#guint"
242 >guint</a> items_per_notification,
244 GnomeVFSAsyncDirectoryLoadCallback callback,
246 href="../glib/glib-Basic-Types.html#gpointer"
247 >gpointer</a> callback_data);
248 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-load-directory-uri">gnome_vfs_async_load_directory_uri</a>
249 (GnomeVFSAsyncHandle **handle_return,
251 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
253 href="../glib/glib-Basic-Types.html#guint"
254 >guint</a> items_per_notification,
256 GnomeVFSAsyncDirectoryLoadCallback callback,
258 href="../glib/glib-Basic-Types.html#gpointer"
259 >gpointer</a> callback_data);
260 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-xfer">gnome_vfs_async_xfer</a> (GnomeVFSAsyncHandle **handle_return,
262 href="../glib/glib-Doubly-Linked-Lists.html#GList"
263 >GList</a> *source_uri_list,
265 href="../glib/glib-Doubly-Linked-Lists.html#GList"
266 >GList</a> *target_uri_list,
267 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferOptions">GnomeVFSXferOptions</a> xfer_options,
268 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferErrorMode">GnomeVFSXferErrorMode</a> error_mode,
269 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferOverwriteMode">GnomeVFSXferOverwriteMode</a> overwrite_mode,
271 GnomeVFSAsyncXferProgressCallback progress_update_callback,
273 href="../glib/glib-Basic-Types.html#gpointer"
274 >gpointer</a> update_callback_data,
275 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferProgressCallback">GnomeVFSXferProgressCallback</a> progress_sync_callback,
277 href="../glib/glib-Basic-Types.html#gpointer"
278 >gpointer</a> sync_callback_data);
279 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-find-directory">gnome_vfs_async_find_directory</a> (GnomeVFSAsyncHandle **handle_return,
281 href="../glib/glib-Doubly-Linked-Lists.html#GList"
282 >GList</a> *near_uri_list,
283 <a href="gnome-vfs-20-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a> kind,
285 href="../glib/glib-Basic-Types.html#gboolean"
286 >gboolean</a> create_if_needed,
288 href="../glib/glib-Basic-Types.html#gboolean"
289 >gboolean</a> find_if_needed,
291 href="../glib/glib-Basic-Types.html#guint"
292 >guint</a> permissions,
294 GnomeVFSAsyncFindDirectoryCallback callback,
296 href="../glib/glib-Basic-Types.html#gpointer"
297 >gpointer</a> user_data);
298 void <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-file-control">gnome_vfs_async_file_control</a> (GnomeVFSAsyncHandle *handle,
299 const char *operation,
301 href="../glib/glib-Basic-Types.html#gpointer"
302 >gpointer</a> operation_data,
304 href="../glib/glib-Datasets.html#GDestroyNotify"
305 >GDestroyNotify</a> operation_data_destroy_func,
306 GnomeVFSAsyncFileControlCallback callback,
308 href="../glib/glib-Basic-Types.html#gpointer"
309 >gpointer</a> callback_data);
310 </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
311 When executing an asynchornous operation on a file the program does not
312 block waiting for the operation to finish, instead it keeps on running,
313 which means that the process and the I/O operation can be both running
314 concurrently. Once the I/O operation has been completed the process is
315 notified using a callback.
317 Asynchronous operations are particularly good when long I/O operations
318 are expected, in this case the program can continue normaly, the I/O
319 will be performed in the background. On the other hand when operations
320 are expected to be short (creating a file, writing/reading small amounts
321 of data, etc.) synchronous operations are prefered.
323 Within a graphical desktop asynchornous I/O operations can be used to
324 avoid blocking the UI (User Interface) during a long operation, and
325 to be able to provide some kind of feedback to the user.
326 </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="GNOME-VFS-PRIORITY-MIN-CAPS"></a>GNOME_VFS_PRIORITY_MIN</h3><a class="indexterm" name="id2905223"></a><pre class="programlisting">#define GNOME_VFS_PRIORITY_MIN -10
328 The minimuum priority a job can have.</p><p>
330 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GNOME-VFS-PRIORITY-MAX-CAPS"></a>GNOME_VFS_PRIORITY_MAX</h3><a class="indexterm" name="id2905260"></a><pre class="programlisting">#define GNOME_VFS_PRIORITY_MAX 10
332 The maximuum priority a job can have.</p><p>
334 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GNOME-VFS-PRIORITY-DEFAULT-CAPS"></a>GNOME_VFS_PRIORITY_DEFAULT</h3><a class="indexterm" name="id2905299"></a><pre class="programlisting">#define GNOME_VFS_PRIORITY_DEFAULT 0
336 The default job priority. Its best to use this
337 unless you have a reason to do otherwise.</p><p>
339 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSAsyncCallback"></a>GnomeVFSAsyncCallback ()</h3><a class="indexterm" name="id2905337"></a><pre class="programlisting">void (*GnomeVFSAsyncCallback) (GnomeVFSAsyncHandle *handle,
340 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> result,
342 href="../glib/glib-Basic-Types.html#gpointer"
343 >gpointer</a> callback_data);</pre><p>
344 Basic callback from an async operation that passes no data back,
345 informing the user of the <i class="parameter"><tt>result</tt></i> of the operation.</p><p>
347 </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 operation generating the callback
348 </td></tr><tr><td><span class="term"><i class="parameter"><tt>result</tt></i> :</span></td><td> <tt class="literal">GNOME_VFS_OK</tt> if the operation was successful, otherwise
350 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> user data defined when the callback was established
351 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSAsyncOpenCallback"></a>GnomeVFSAsyncOpenCallback</h3><a class="indexterm" name="id2905480"></a><pre class="programlisting">typedef GnomeVFSAsyncCallback GnomeVFSAsyncOpenCallback;
353 Basic callback from an async operation that passes no data back,
354 informing the user of the <i class="parameter"><tt>result</tt></i> of the operation.</p><p>
356 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSAsyncCreateCallback"></a>GnomeVFSAsyncCreateCallback</h3><a class="indexterm" name="id2905525"></a><pre class="programlisting">typedef GnomeVFSAsyncCallback GnomeVFSAsyncCreateCallback;
358 Basic callback from an async operation that passes no data back,
359 informing the user of the <i class="parameter"><tt>result</tt></i> of the operation.</p><p>
361 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSAsyncCreateAsChannelCallback"></a>GnomeVFSAsyncCreateAsChannelCallback</h3><a class="indexterm" name="id2905573"></a><pre class="programlisting">typedef GnomeVFSAsyncOpenAsChannelCallback GnomeVFSAsyncCreateAsChannelCallback;
363 Callback for the <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-create-as-channel"><tt class="function">gnome_vfs_async_create_as_channel()</tt></a> function.</p><p>
365 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSAsyncCloseCallback"></a>GnomeVFSAsyncCloseCallback</h3><a class="indexterm" name="id2905624"></a><pre class="programlisting">typedef GnomeVFSAsyncCallback GnomeVFSAsyncCloseCallback;
367 Basic callback from an async operation that passes no data back,
368 informing the user of the <i class="parameter"><tt>result</tt></i> of the operation.</p><p>
370 </p></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSAsyncReadCallback"></a>GnomeVFSAsyncReadCallback ()</h3><a class="indexterm" name="id2905670"></a><pre class="programlisting">void (*GnomeVFSAsyncReadCallback) (GnomeVFSAsyncHandle *handle,
371 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> result,
373 href="../glib/glib-Basic-Types.html#gpointer"
374 >gpointer</a> buffer,
375 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_requested,
376 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_read,
378 href="../glib/glib-Basic-Types.html#gpointer"
379 >gpointer</a> callback_data);</pre><p>
380 Callback for the <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-read"><tt class="function">gnome_vfs_async_read()</tt></a> function.</p><p>
382 </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 operation generating the callback
383 </td></tr><tr><td><span class="term"><i class="parameter"><tt>result</tt></i> :</span></td><td> <tt class="literal">GNOME_VFS_OK</tt> if the operation was successful, otherwise
385 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> buffer containing data read from <i class="parameter"><tt>handle</tt></i>.
386 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_requested</tt></i> :</span></td><td> the number of bytes asked for in the call to
387 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-read"><tt class="function">gnome_vfs_async_read()</tt></a>.
388 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_read</tt></i> :</span></td><td> the number of bytes actually read from <i class="parameter"><tt>handle</tt></i> into <i class="parameter"><tt>buffer</tt></i>.
389 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> user data defined when the callback was established
390 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSAsyncWriteCallback"></a>GnomeVFSAsyncWriteCallback ()</h3><a class="indexterm" name="id2905930"></a><pre class="programlisting">void (*GnomeVFSAsyncWriteCallback) (GnomeVFSAsyncHandle *handle,
391 <a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> result,
393 href="../glib/glib-Basic-Types.html#gconstpointer"
394 >gconstpointer</a> buffer,
395 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_requested,
396 <a href="gnome-vfs-20-gnome-vfs-file-size.html#GnomeVFSFileSize">GnomeVFSFileSize</a> bytes_written,
398 href="../glib/glib-Basic-Types.html#gpointer"
399 >gpointer</a> callback_data);</pre><p>
400 Callback for the <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-write"><tt class="function">gnome_vfs_async_write()</tt></a> function.</p><p>
402 </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 operation generating the callback
403 </td></tr><tr><td><span class="term"><i class="parameter"><tt>result</tt></i> :</span></td><td> <tt class="literal">GNOME_VFS_OK</tt> if the operation was successful, otherwise
405 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> buffer containing data written to <i class="parameter"><tt>handle</tt></i>.
406 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_requested</tt></i> :</span></td><td> the number of bytes asked to write in the call to
407 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-write"><tt class="function">gnome_vfs_async_write()</tt></a>.
408 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes_written</tt></i> :</span></td><td> the number of bytes actually written to <i class="parameter"><tt>handle</tt></i> from <i class="parameter"><tt>buffer</tt></i>.
409 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> user data defined when the callback was established
410 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="GnomeVFSFindDirectoryResult"></a>GnomeVFSFindDirectoryResult</h3><a class="indexterm" name="id2906190"></a><pre class="programlisting">typedef struct {
412 GnomeVFSResult result;
414 /* Reserved to avoid future breaks in ABI compatibility */
417 } GnomeVFSFindDirectoryResult;
420 </p></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-set-job-limit"></a>gnome_vfs_async_set_job_limit ()</h3><a class="indexterm" name="id2906227"></a><pre class="programlisting">void gnome_vfs_async_set_job_limit (int limit);</pre><p>
421 Restrict the number of worker threads used by Async operations
422 to <i class="parameter"><tt>limit</tt></i>.</p><p>
424 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>limit</tt></i> :</span></td><td> maximuum number of allowable threads
425 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-get-job-limit"></a>gnome_vfs_async_get_job_limit ()</h3><a class="indexterm" name="id2906310"></a><pre class="programlisting">int gnome_vfs_async_get_job_limit (void);</pre><p>
426 Get the current maximuum allowable number of
427 worker threads for Asynch operations.</p><p>
429 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> current maximuum number of threads
430 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-cancel"></a>gnome_vfs_async_cancel ()</h3><a class="indexterm" name="id2906374"></a><pre class="programlisting">void gnome_vfs_async_cancel (GnomeVFSAsyncHandle *handle);</pre><p>
431 Cancel an asynchronous operation and close all its callbacks.
432 Its possible to still receive another call or two on the callback.</p><p>
434 </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 async operation to be cancelled
435 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-open"></a>gnome_vfs_async_open ()</h3><a class="indexterm" name="id2906450"></a><pre class="programlisting">void gnome_vfs_async_open (GnomeVFSAsyncHandle **handle_return,
437 href="../glib/glib-Basic-Types.html#gchar"
438 >gchar</a> *text_uri,
439 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
441 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
443 href="../glib/glib-Basic-Types.html#gpointer"
444 >gpointer</a> callback_data);</pre><p>
445 Open <i class="parameter"><tt>text_uri</tt></i> according to mode <i class="parameter"><tt>open_mode</tt></i>. On return, <i class="parameter"><tt>handle_return</tt></i> will
446 contain a pointer to the operation. Once the file has been successfully opened,
447 <i class="parameter"><tt>callback</tt></i> will be called with the GnomeVFSResult.</p><p>
449 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> A pointer to a pointer to a GnomeVFSHandle object
450 </td></tr><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> string of the URI to open
451 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td> Open mode
452 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
453 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
454 in allocating threads from the thread pool.
455 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
456 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
457 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-open-uri"></a>gnome_vfs_async_open_uri ()</h3><a class="indexterm" name="id2906715"></a><pre class="programlisting">void gnome_vfs_async_open_uri (GnomeVFSAsyncHandle **handle_return,
459 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
461 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
463 href="../glib/glib-Basic-Types.html#gpointer"
464 >gpointer</a> callback_data);</pre><p>
465 Open <i class="parameter"><tt>uri</tt></i> according to mode <i class="parameter"><tt>open_mode</tt></i>. On return, <i class="parameter"><tt>handle_return</tt></i> will
466 contain a pointer to the operation. Once the file has been successfully opened,
467 <i class="parameter"><tt>callback</tt></i> will be called with the GnomeVFSResult.</p><p>
469 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> A pointer to a pointer to a GnomeVFSHandle object
470 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> URI to open
471 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td> Open mode
472 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
473 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
474 in allocating threads from the thread pool.
475 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
476 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
477 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-open-as-channel"></a>gnome_vfs_async_open_as_channel ()</h3><a class="indexterm" name="id2906978"></a><pre class="programlisting">void gnome_vfs_async_open_as_channel (GnomeVFSAsyncHandle **handle_return,
479 href="../glib/glib-Basic-Types.html#gchar"
480 >gchar</a> *text_uri,
481 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
483 href="../glib/glib-Basic-Types.html#guint"
484 >guint</a> advised_block_size,
486 GnomeVFSAsyncOpenAsChannelCallback callback,
488 href="../glib/glib-Basic-Types.html#gpointer"
489 >gpointer</a> callback_data);</pre><p>
490 Open <i class="parameter"><tt>text_uri</tt></i> as a <a
491 href="../glib/glib-IO-Channels.html#GIOChannel"
492 ><span class="type">GIOChannel</span></a>. Once the channel has been established
493 <i class="parameter"><tt>callback</tt></i> will be called with <i class="parameter"><tt>callback_data</tt></i>, the result of the operation,
494 and if the result was <tt class="literal">GNOME_VFS_OK</tt>, a reference to a <a
495 href="../glib/glib-IO-Channels.html#GIOChannel"
496 ><span class="type">GIOChannel</span></a> pointing
497 at <i class="parameter"><tt>text_uri</tt></i> in <i class="parameter"><tt>open_mode</tt></i>.</p><p>
499 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> A pointer to a pointer to a GnomeVFSHandle object
500 </td></tr><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> string of the URI to open as a <a
501 href="../glib/glib-IO-Channels.html#GIOChannel"
502 ><span class="type">GIOChannel</span></a>
503 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td> open for reading, writing, random, etc
504 </td></tr><tr><td><span class="term"><i class="parameter"><tt>advised_block_size</tt></i> :</span></td><td> the preferred block size for <a
505 href="../glib/glib-IO-Channels.html#GIOChannel"
506 ><span class="type">GIOChannel</span></a> to read
507 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
508 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
509 in allocating threads from the thread pool.
510 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
511 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
512 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-open-uri-as-channel"></a>gnome_vfs_async_open_uri_as_channel ()</h3><a class="indexterm" name="id2907323"></a><pre class="programlisting">void gnome_vfs_async_open_uri_as_channel
513 (GnomeVFSAsyncHandle **handle_return,
515 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
517 href="../glib/glib-Basic-Types.html#guint"
518 >guint</a> advised_block_size,
520 GnomeVFSAsyncOpenAsChannelCallback callback,
522 href="../glib/glib-Basic-Types.html#gpointer"
523 >gpointer</a> callback_data);</pre><p>
524 Open <i class="parameter"><tt>uri</tt></i> as a <a
525 href="../glib/glib-IO-Channels.html#GIOChannel"
526 ><span class="type">GIOChannel</span></a>. Once the channel has been established
527 <i class="parameter"><tt>callback</tt></i> will be called with <i class="parameter"><tt>callback_data</tt></i>, the result of the operation,
528 and if the result was <tt class="literal">GNOME_VFS_OK</tt>, a reference to a <a
529 href="../glib/glib-IO-Channels.html#GIOChannel"
530 ><span class="type">GIOChannel</span></a> pointing
531 at <i class="parameter"><tt>uri</tt></i> in <i class="parameter"><tt>open_mode</tt></i>.</p><p>
533 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> A pointer to a pointer to a GnomeVFSHandle object
534 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> URI to open as a <a
535 href="../glib/glib-IO-Channels.html#GIOChannel"
536 ><span class="type">GIOChannel</span></a>
537 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td> open for reading, writing, random, etc
538 </td></tr><tr><td><span class="term"><i class="parameter"><tt>advised_block_size</tt></i> :</span></td><td> the preferred block size for <a
539 href="../glib/glib-IO-Channels.html#GIOChannel"
540 ><span class="type">GIOChannel</span></a> to read
541 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
542 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
543 in allocating threads from the thread pool.
544 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
545 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
546 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-create"></a>gnome_vfs_async_create ()</h3><a class="indexterm" name="id2907666"></a><pre class="programlisting">void gnome_vfs_async_create (GnomeVFSAsyncHandle **handle_return,
548 href="../glib/glib-Basic-Types.html#gchar"
549 >gchar</a> *text_uri,
550 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
552 href="../glib/glib-Basic-Types.html#gboolean"
553 >gboolean</a> exclusive,
555 href="../glib/glib-Basic-Types.html#guint"
558 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
560 href="../glib/glib-Basic-Types.html#gpointer"
561 >gpointer</a> callback_data);</pre><p>
562 Create a file at <i class="parameter"><tt>uri</tt></i> according to mode <i class="parameter"><tt>open_mode</tt></i>, with permissions <i class="parameter"><tt>perm</tt></i> (in
563 the standard UNIX packed bit permissions format). When the create has been completed
564 <i class="parameter"><tt>callback</tt></i> will be called with the result code and <i class="parameter"><tt>callback_data</tt></i>.</p><p>
566 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> A pointer to a pointer to a GnomeVFSHandle object
567 </td></tr><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> String representing the URI to create
568 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td> mode to leave the file opened in after creation (or <tt class="literal">GNOME_VFS_OPEN_MODE_NONE</tt>
569 to leave the file closed after creation)
570 </td></tr><tr><td><span class="term"><i class="parameter"><tt>exclusive</tt></i> :</span></td><td> Whether the file should be created in "exclusive" mode:
571 i.e. if this flag is nonzero, operation will fail if a file with the
572 same name already exists.
573 </td></tr><tr><td><span class="term"><i class="parameter"><tt>perm</tt></i> :</span></td><td> Bitmap representing the permissions for the newly created file
575 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
576 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
577 in allocating threads from the thread pool.
578 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
579 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
580 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-create-uri"></a>gnome_vfs_async_create_uri ()</h3><a class="indexterm" name="id2908002"></a><pre class="programlisting">void gnome_vfs_async_create_uri (GnomeVFSAsyncHandle **handle_return,
582 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
584 href="../glib/glib-Basic-Types.html#gboolean"
585 >gboolean</a> exclusive,
587 href="../glib/glib-Basic-Types.html#guint"
590 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
592 href="../glib/glib-Basic-Types.html#gpointer"
593 >gpointer</a> callback_data);</pre><p>
594 Create a file at <i class="parameter"><tt>uri</tt></i> according to mode <i class="parameter"><tt>open_mode</tt></i>, with permissions <i class="parameter"><tt>perm</tt></i> (in
595 the standard UNIX packed bit permissions format). When the create has been completed
596 <i class="parameter"><tt>callback</tt></i> will be called with the result code and <i class="parameter"><tt>callback_data</tt></i>.</p><p>
598 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> A pointer to a pointer to a GnomeVFSHandle object
599 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> the URI to create a file at
600 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td> mode to leave the file opened in after creation (or <tt class="literal">GNOME_VFS_OPEN_MODE_NONE</tt>
601 to leave the file closed after creation)
602 </td></tr><tr><td><span class="term"><i class="parameter"><tt>exclusive</tt></i> :</span></td><td> Whether the file should be created in "exclusive" mode:
603 i.e. if this flag is nonzero, operation will fail if a file with the
604 same name already exists.
605 </td></tr><tr><td><span class="term"><i class="parameter"><tt>perm</tt></i> :</span></td><td> Bitmap representing the permissions for the newly created file
607 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
608 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
609 in allocating threads from the thread pool.
610 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
611 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
612 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-create-symbolic-link"></a>gnome_vfs_async_create_symbolic_link ()</h3><a class="indexterm" name="id2908339"></a><pre class="programlisting">void gnome_vfs_async_create_symbolic_link
613 (GnomeVFSAsyncHandle **handle_return,
616 href="../glib/glib-Basic-Types.html#gchar"
617 >gchar</a> *uri_reference,
619 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncOpenCallback">GnomeVFSAsyncOpenCallback</a> callback,
621 href="../glib/glib-Basic-Types.html#gpointer"
622 >gpointer</a> callback_data);</pre><p>
623 Create a symbolic link at <i class="parameter"><tt>uri</tt></i> pointing to <i class="parameter"><tt>uri_reference</tt></i>. When the operation
624 has complete <i class="parameter"><tt>callback</tt></i> will be called with the result of the operation and
625 <i class="parameter"><tt>callback_data</tt></i>.</p><p>
627 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> when the function returns will point to a handle for
629 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> location to create the link at
630 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri_reference</tt></i> :</span></td><td> location to point <i class="parameter"><tt>uri</tt></i> to (can be a URI fragment, i.e. relative)
631 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
632 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
633 in allocating threads from the thread pool.
634 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
635 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
636 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-create-as-channel"></a>gnome_vfs_async_create_as_channel ()</h3><a class="indexterm" name="id2908612"></a><pre class="programlisting">void gnome_vfs_async_create_as_channel
637 (GnomeVFSAsyncHandle **handle_return,
639 href="../glib/glib-Basic-Types.html#gchar"
640 >gchar</a> *text_uri,
641 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
643 href="../glib/glib-Basic-Types.html#gboolean"
644 >gboolean</a> exclusive,
646 href="../glib/glib-Basic-Types.html#guint"
649 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCreateAsChannelCallback">GnomeVFSAsyncCreateAsChannelCallback</a> callback,
651 href="../glib/glib-Basic-Types.html#gpointer"
652 >gpointer</a> callback_data);</pre><p>
653 Open <i class="parameter"><tt>text_uri</tt></i> as a <a
654 href="../glib/glib-IO-Channels.html#GIOChannel"
655 ><span class="type">GIOChannel</span></a>, creating it as necessary. Once the channel has
656 been established <i class="parameter"><tt>callback</tt></i> will be called with <i class="parameter"><tt>callback_data</tt></i>, the result of the
657 operation, and if the result was <tt class="literal">GNOME_VFS_OK</tt>, a reference to a <a
658 href="../glib/glib-IO-Channels.html#GIOChannel"
659 ><span class="type">GIOChannel</span></a> pointing
660 at <i class="parameter"><tt>text_uri</tt></i> in <i class="parameter"><tt>open_mode</tt></i>.</p><p>
662 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> A pointer to a pointer to a GnomeVFSHandle object
663 </td></tr><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> string of the URI to open as a <a
664 href="../glib/glib-IO-Channels.html#GIOChannel"
665 ><span class="type">GIOChannel</span></a>, creating it as necessary
666 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td> open for reading, writing, random, etc
667 </td></tr><tr><td><span class="term"><i class="parameter"><tt>exclusive</tt></i> :</span></td><td> replace the file if it already exists
668 </td></tr><tr><td><span class="term"><i class="parameter"><tt>perm</tt></i> :</span></td><td> standard POSIX-style permissions bitmask, permissions of created file
669 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
670 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
671 in allocating threads from the thread pool.
672 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
673 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
674 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-create-uri-as-channel"></a>gnome_vfs_async_create_uri_as_channel ()</h3><a class="indexterm" name="id2908976"></a><pre class="programlisting">void gnome_vfs_async_create_uri_as_channel
675 (GnomeVFSAsyncHandle **handle_return,
677 <a href="gnome-vfs-20-gnome-vfs-file-basic-ops.html#GnomeVFSOpenMode">GnomeVFSOpenMode</a> open_mode,
679 href="../glib/glib-Basic-Types.html#gboolean"
680 >gboolean</a> exclusive,
682 href="../glib/glib-Basic-Types.html#guint"
685 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCreateAsChannelCallback">GnomeVFSAsyncCreateAsChannelCallback</a> callback,
687 href="../glib/glib-Basic-Types.html#gpointer"
688 >gpointer</a> callback_data);</pre><p>
690 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td>
691 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td>
692 </td></tr><tr><td><span class="term"><i class="parameter"><tt>open_mode</tt></i> :</span></td><td>
693 </td></tr><tr><td><span class="term"><i class="parameter"><tt>exclusive</tt></i> :</span></td><td>
694 </td></tr><tr><td><span class="term"><i class="parameter"><tt>perm</tt></i> :</span></td><td>
695 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td>
696 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td>
697 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td>
700 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-close"></a>gnome_vfs_async_close ()</h3><a class="indexterm" name="id2909227"></a><pre class="programlisting">void gnome_vfs_async_close (GnomeVFSAsyncHandle *handle,
701 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncCloseCallback">GnomeVFSAsyncCloseCallback</a> callback,
703 href="../glib/glib-Basic-Types.html#gpointer"
704 >gpointer</a> callback_data);</pre><p>
705 Close a handle opened with <a href="gnome-vfs-20-gnome-vfs-async-ops.html#gnome-vfs-async-open"><tt class="function">gnome_vfs_async_open()</tt></a>. When the close
706 has completed, <i class="parameter"><tt>callback</tt></i> will be called with <i class="parameter"><tt>callback_data</tt></i> and
707 the result of the operation.</p><p>
709 </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> async handle to close
710 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
711 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
712 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-read"></a>gnome_vfs_async_read ()</h3><a class="indexterm" name="id2909389"></a><pre class="programlisting">void gnome_vfs_async_read (GnomeVFSAsyncHandle *handle,
714 href="../glib/glib-Basic-Types.html#gpointer"
715 >gpointer</a> buffer,
717 href="../glib/glib-Basic-Types.html#guint"
719 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncReadCallback">GnomeVFSAsyncReadCallback</a> callback,
721 href="../glib/glib-Basic-Types.html#gpointer"
722 >gpointer</a> callback_data);</pre><p>
723 Read <i class="parameter"><tt>bytes</tt></i> bytes from the file pointed to be <i class="parameter"><tt>handle</tt></i> into <i class="parameter"><tt>buffer</tt></i>.
724 When the operation is complete, <i class="parameter"><tt>callback</tt></i> will be called with the
725 result of the operation and <i class="parameter"><tt>callback_data</tt></i>.</p><p>
727 </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 for the file to be read
728 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> allocated block of memory to read into
729 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td> number of bytes to read
730 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
731 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
732 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-write"></a>gnome_vfs_async_write ()</h3><a class="indexterm" name="id2909610"></a><pre class="programlisting">void gnome_vfs_async_write (GnomeVFSAsyncHandle *handle,
734 href="../glib/glib-Basic-Types.html#gconstpointer"
735 >gconstpointer</a> buffer,
737 href="../glib/glib-Basic-Types.html#guint"
739 <a href="gnome-vfs-20-gnome-vfs-async-ops.html#GnomeVFSAsyncWriteCallback">GnomeVFSAsyncWriteCallback</a> callback,
741 href="../glib/glib-Basic-Types.html#gpointer"
742 >gpointer</a> callback_data);</pre><p>
743 Write <i class="parameter"><tt>bytes</tt></i> bytes from <i class="parameter"><tt>buffer</tt></i> into the file pointed to be <i class="parameter"><tt>handle</tt></i>.
744 When the operation is complete, <i class="parameter"><tt>callback</tt></i> will be called with the
745 result of the operation and <i class="parameter"><tt>callback_data</tt></i>.</p><p>
747 </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 for the file to be written
748 </td></tr><tr><td><span class="term"><i class="parameter"><tt>buffer</tt></i> :</span></td><td> block of memory containing data to be written
749 </td></tr><tr><td><span class="term"><i class="parameter"><tt>bytes</tt></i> :</span></td><td> number of bytes to write
750 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
751 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
752 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-get-file-info"></a>gnome_vfs_async_get_file_info ()</h3><a class="indexterm" name="id2909833"></a><pre class="programlisting">void gnome_vfs_async_get_file_info (GnomeVFSAsyncHandle **handle_return,
754 href="../glib/glib-Doubly-Linked-Lists.html#GList"
755 >GList</a> *uri_list,
756 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
758 GnomeVFSAsyncGetFileInfoCallback callback,
760 href="../glib/glib-Basic-Types.html#gpointer"
761 >gpointer</a> callback_data);</pre><p>
762 Fetch information about the files indicated in <i class="parameter"><tt>uris</tt></i> and return the
763 information progressively to <i class="parameter"><tt>callback</tt></i>.</p><p>
765 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> when the function returns will point to a handle for
767 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri_list</tt></i> :</span></td><td> a GList of GnomeVFSURIs to fetch information about
768 </td></tr><tr><td><span class="term"><i class="parameter"><tt>options</tt></i> :</span></td><td> packed boolean type providing control over various details
769 of the get_file_info operation.
770 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
771 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
772 in allocating threads from the thread pool.
773 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
774 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
775 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-set-file-info"></a>gnome_vfs_async_set_file_info ()</h3><a class="indexterm" name="id2910088"></a><pre class="programlisting">void gnome_vfs_async_set_file_info (GnomeVFSAsyncHandle **handle_return,
777 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfo">GnomeVFSFileInfo</a> *info,
778 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSSetFileInfoMask">GnomeVFSSetFileInfoMask</a> mask,
779 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
781 GnomeVFSAsyncSetFileInfoCallback callback,
783 href="../glib/glib-Basic-Types.html#gpointer"
784 >gpointer</a> callback_data);</pre><p>
785 Set "file info" details about the file at <i class="parameter"><tt>uri</tt></i>, such as permissions, name,
786 owner, and modification time.</p><p>
788 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> when the function returns will point to a handle for
790 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> the URI to set the file info of
791 </td></tr><tr><td><span class="term"><i class="parameter"><tt>info</tt></i> :</span></td><td> the struct containing new information about the file
792 </td></tr><tr><td><span class="term"><i class="parameter"><tt>mask</tt></i> :</span></td><td> control which fields of <i class="parameter"><tt>info</tt></i> are changed about the file at <i class="parameter"><tt>uri</tt></i>
793 </td></tr><tr><td><span class="term"><i class="parameter"><tt>options</tt></i> :</span></td><td> packed boolean type providing control over various details
794 of the set_file_info operation.
795 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
796 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
797 in allocating threads from the thread pool.
798 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
799 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
800 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-load-directory"></a>gnome_vfs_async_load_directory ()</h3><a class="indexterm" name="id2910403"></a><pre class="programlisting">void gnome_vfs_async_load_directory (GnomeVFSAsyncHandle **handle_return,
802 href="../glib/glib-Basic-Types.html#gchar"
803 >gchar</a> *text_uri,
804 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
806 href="../glib/glib-Basic-Types.html#guint"
807 >guint</a> items_per_notification,
809 GnomeVFSAsyncDirectoryLoadCallback callback,
811 href="../glib/glib-Basic-Types.html#gpointer"
812 >gpointer</a> callback_data);</pre><p>
813 Read the contents of the directory at <i class="parameter"><tt>text_uri</tt></i>, passing back GnomeVFSFileInfo
814 structs about each file in the directory to <i class="parameter"><tt>callback</tt></i>. <i class="parameter"><tt>items_per_notification</tt></i>
815 files will be processed between each call to <i class="parameter"><tt>callback</tt></i>.</p><p>
817 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> when the function returns will point to a handle for
819 </td></tr><tr><td><span class="term"><i class="parameter"><tt>text_uri</tt></i> :</span></td><td> string representing the URI of the directory to be loaded
820 </td></tr><tr><td><span class="term"><i class="parameter"><tt>options</tt></i> :</span></td><td> packed boolean type providing control over various details
821 of the get_file_info operation.
822 </td></tr><tr><td><span class="term"><i class="parameter"><tt>items_per_notification</tt></i> :</span></td><td> number of files to process in a row before calling <i class="parameter"><tt>callback</tt></i>
823 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
824 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
825 in allocating threads from the thread pool.
826 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
827 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
828 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-load-directory-uri"></a>gnome_vfs_async_load_directory_uri ()</h3><a class="indexterm" name="id2910706"></a><pre class="programlisting">void gnome_vfs_async_load_directory_uri
829 (GnomeVFSAsyncHandle **handle_return,
831 <a href="gnome-vfs-20-gnome-vfs-file-info.html#GnomeVFSFileInfoOptions">GnomeVFSFileInfoOptions</a> options,
833 href="../glib/glib-Basic-Types.html#guint"
834 >guint</a> items_per_notification,
836 GnomeVFSAsyncDirectoryLoadCallback callback,
838 href="../glib/glib-Basic-Types.html#gpointer"
839 >gpointer</a> callback_data);</pre><p>
840 Read the contents of the directory at <i class="parameter"><tt>uri</tt></i>, passing back GnomeVFSFileInfo structs
841 about each file in the directory to <i class="parameter"><tt>callback</tt></i>. <i class="parameter"><tt>items_per_notification</tt></i>
842 files will be processed between each call to <i class="parameter"><tt>callback</tt></i>.</p><p>
844 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> when the function returns will point to a handle for
846 </td></tr><tr><td><span class="term"><i class="parameter"><tt>uri</tt></i> :</span></td><td> string representing the URI of the directory to be loaded
847 </td></tr><tr><td><span class="term"><i class="parameter"><tt>options</tt></i> :</span></td><td> packed boolean type providing control over various details
848 of the get_file_info operation.
849 </td></tr><tr><td><span class="term"><i class="parameter"><tt>items_per_notification</tt></i> :</span></td><td> number of files to process in a row before calling <i class="parameter"><tt>callback</tt></i>
850 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
851 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
852 in allocating threads from the thread pool.
853 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
854 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
855 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-xfer"></a>gnome_vfs_async_xfer ()</h3><a class="indexterm" name="id2911009"></a><pre class="programlisting"><a href="gnome-vfs-20-gnome-vfs-result.html#GnomeVFSResult">GnomeVFSResult</a> gnome_vfs_async_xfer (GnomeVFSAsyncHandle **handle_return,
857 href="../glib/glib-Doubly-Linked-Lists.html#GList"
858 >GList</a> *source_uri_list,
860 href="../glib/glib-Doubly-Linked-Lists.html#GList"
861 >GList</a> *target_uri_list,
862 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferOptions">GnomeVFSXferOptions</a> xfer_options,
863 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferErrorMode">GnomeVFSXferErrorMode</a> error_mode,
864 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferOverwriteMode">GnomeVFSXferOverwriteMode</a> overwrite_mode,
866 GnomeVFSAsyncXferProgressCallback progress_update_callback,
868 href="../glib/glib-Basic-Types.html#gpointer"
869 >gpointer</a> update_callback_data,
870 <a href="gnome-vfs-20-gnome-vfs-xfer.html#GnomeVFSXferProgressCallback">GnomeVFSXferProgressCallback</a> progress_sync_callback,
872 href="../glib/glib-Basic-Types.html#gpointer"
873 >gpointer</a> sync_callback_data);</pre><p>
874 Perform a copy operation in a seperate thread. <i class="parameter"><tt>progress_update_callback</tt></i> will be periodically
875 polled with status of the operation (percent done, the current phase of operation, the
876 current file being operated upon). If the xfer engine needs to query the caller to make
877 a decision or report on important error it will do so on <i class="parameter"><tt>progress_sync_callback</tt></i>.</p><p>
879 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> when the function returns will point to a handle for
880 </td></tr><tr><td><span class="term"><i class="parameter"><tt>source_uri_list</tt></i> :</span></td><td> <a
881 href="../glib/glib-Doubly-Linked-Lists.html#GList"
882 ><span class="type">GList</span></a> of <span class="type">GnomeVFSURI</span> representing the files to be transferred
883 </td></tr><tr><td><span class="term"><i class="parameter"><tt>target_uri_list</tt></i> :</span></td><td> <a
884 href="../glib/glib-Doubly-Linked-Lists.html#GList"
885 ><span class="type">GList</span></a> of <span class="type">GnomeVFSURI</span>, the target locations for the elements
886 in <i class="parameter"><tt>source_uri_list</tt></i>
887 </td></tr><tr><td><span class="term"><i class="parameter"><tt>xfer_options</tt></i> :</span></td><td> various options controlling the details of the transfer.
888 Use <tt class="literal">GNOME_VFS_XFER_REMOUVESOURCE</tt> to make the operation a move rather than a copy.
889 </td></tr><tr><td><span class="term"><i class="parameter"><tt>error_mode</tt></i> :</span></td><td> report errors to the <i class="parameter"><tt>progress_sync_callback</tt></i>, or simply abort
890 </td></tr><tr><td><span class="term"><i class="parameter"><tt>overwrite_mode</tt></i> :</span></td><td> controls whether the xfer engine will overwrite automatically,
891 skip the file, abort the operation, or query <i class="parameter"><tt>progress_sync_callback</tt></i>
892 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
893 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
894 in allocating threads from the thread pool.
895 </td></tr><tr><td><span class="term"><i class="parameter"><tt>progress_update_callback</tt></i> :</span></td><td> called periodically to keep the client appraised of progress
896 in completing the XFer operation, and the current phase of operation.
897 </td></tr><tr><td><span class="term"><i class="parameter"><tt>update_callback_data</tt></i> :</span></td><td> user data passed to <i class="parameter"><tt>progress_update_callback</tt></i>
898 </td></tr><tr><td><span class="term"><i class="parameter"><tt>progress_sync_callback</tt></i> :</span></td><td> called when the program requires responses to interactive queries
899 (e.g. overwriting files, handling errors, etc)
900 </td></tr><tr><td><span class="term"><i class="parameter"><tt>sync_callback_data</tt></i> :</span></td><td> user data passed to <i class="parameter"><tt>progress_sync_callback</tt></i>
901 </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <tt class="literal">GNOME_VFS_OK</tt> if the paramaters were in order,
902 or <tt class="literal">GNOME_VFS_ERROR_BAD_PARAMETERS</tt> if something was wrong in the passed in arguments.
903 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-find-directory"></a>gnome_vfs_async_find_directory ()</h3><a class="indexterm" name="id2911509"></a><pre class="programlisting">void gnome_vfs_async_find_directory (GnomeVFSAsyncHandle **handle_return,
905 href="../glib/glib-Doubly-Linked-Lists.html#GList"
906 >GList</a> *near_uri_list,
907 <a href="gnome-vfs-20-gnome-vfs-directory-find-ops.html#GnomeVFSFindDirectoryKind">GnomeVFSFindDirectoryKind</a> kind,
909 href="../glib/glib-Basic-Types.html#gboolean"
910 >gboolean</a> create_if_needed,
912 href="../glib/glib-Basic-Types.html#gboolean"
913 >gboolean</a> find_if_needed,
915 href="../glib/glib-Basic-Types.html#guint"
916 >guint</a> permissions,
918 GnomeVFSAsyncFindDirectoryCallback callback,
920 href="../glib/glib-Basic-Types.html#gpointer"
921 >gpointer</a> user_data);</pre><p>
922 There is quite a complicated logic behind finding/creating a Trash directory
923 and you need to be aware of some implications:
924 Finding the Trash the first time when using the file method may be pretty
925 expensive. A cache file is used to store the location of that Trash file
927 If <i class="parameter"><tt>ceate_if_needed</tt></i> is specified without <i class="parameter"><tt>find_if_needed</tt></i>, you may end up
928 creating a Trash file when there already is one. Your app should start out
929 by doing a gnome_vfs_find_directory with the <i class="parameter"><tt>find_if_needed</tt></i> to avoid this
930 and then use the <i class="parameter"><tt>create_if_needed</tt></i> flag to create Trash lazily when it is
931 needed for throwing away an item on a given disk.
933 When the operation has completed, <i class="parameter"><tt>callback</tt></i> will be called with the result
934 of the operation and <i class="parameter"><tt>user_data</tt></i>.</p><p>
936 </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i class="parameter"><tt>handle_return</tt></i> :</span></td><td> when the function returns will point to a handle for
937 </td></tr><tr><td><span class="term"><i class="parameter"><tt>near_uri_list</tt></i> :</span></td><td> a GList of GnomeVFSURIs, find a special directory on the same
938 volume as <i class="parameter"><tt>uris</tt></i>
939 </td></tr><tr><td><span class="term"><i class="parameter"><tt>kind</tt></i> :</span></td><td> kind of special directory
940 </td></tr><tr><td><span class="term"><i class="parameter"><tt>create_if_needed</tt></i> :</span></td><td> If directory we are looking for does not exist, try to create it
941 </td></tr><tr><td><span class="term"><i class="parameter"><tt>find_if_needed</tt></i> :</span></td><td> If we don't know where the directory is yet, look for it.
942 </td></tr><tr><td><span class="term"><i class="parameter"><tt>permissions</tt></i> :</span></td><td> If creating, use these permissions
943 </td></tr><tr><td><span class="term"><i class="parameter"><tt>priority</tt></i> :</span></td><td> a value from <tt class="literal">GNOME_VFS_PRIORITY_MIN</tt> to <tt class="literal">GNOME_VFS_PRIORITY_MAX</tt> (normally
944 should be <tt class="literal">GNOME_VFS_PRIORITY_DEFAULT</tt>) indicating the priority to assign this job
945 in allocating threads from the thread pool.
946 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
947 </td></tr><tr><td><span class="term"><i class="parameter"><tt>user_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i> *
948 Used to return special directories such as Trash and Desktop from different
950 </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><h3><a name="gnome-vfs-async-file-control"></a>gnome_vfs_async_file_control ()</h3><a class="indexterm" name="id2911892"></a><pre class="programlisting">void gnome_vfs_async_file_control (GnomeVFSAsyncHandle *handle,
951 const char *operation,
953 href="../glib/glib-Basic-Types.html#gpointer"
954 >gpointer</a> operation_data,
956 href="../glib/glib-Datasets.html#GDestroyNotify"
957 >GDestroyNotify</a> operation_data_destroy_func,
958 GnomeVFSAsyncFileControlCallback callback,
960 href="../glib/glib-Basic-Types.html#gpointer"
961 >gpointer</a> callback_data);</pre><p>
962 Execute a backend dependent operation specified by the string <i class="parameter"><tt>operation</tt></i>.
963 This is typically used for specialized vfs backends that need additional
964 operations that gnome-vfs doesn't have. Compare it to the unix call <tt class="function">ioctl()</tt>.
965 The format of <i class="parameter"><tt>operation_data</tt></i> depends on the operation. Operation that are
966 backend specific are normally namespaced by their module name.
968 When the operation is complete, <i class="parameter"><tt>callback</tt></i> will be called with the
969 result of the operation, <i class="parameter"><tt>operation_data</tt></i> and <i class="parameter"><tt>callback_data</tt></i>.</p><p>
971 </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 file to affect
972 </td></tr><tr><td><span class="term"><i class="parameter"><tt>operation</tt></i> :</span></td><td> The operation to execute
973 </td></tr><tr><td><span class="term"><i class="parameter"><tt>operation_data</tt></i> :</span></td><td> The data needed to execute the operation
974 </td></tr><tr><td><span class="term"><i class="parameter"><tt>operation_data_destroy_func</tt></i> :</span></td><td> Called to destroy operation_data when its no longer needed
975 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback</tt></i> :</span></td><td> function to be called when the operation is complete
976 </td></tr><tr><td><span class="term"><i class="parameter"><tt>callback_data</tt></i> :</span></td><td> data to pass <i class="parameter"><tt>callback</tt></i>
977 </td></tr></tbody></table></div><p>Since 2.2
978 </p></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="gnome-vfs-20-gnome-vfs-file-advanced-ops.html"><b><< Advanced File Operations</b></a></td><td align="right"><a accesskey="n" href="advanced-operations.html"><b>Advanced Operations >></b></a></td></tr></table></body></html>