1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2006-2007 Red Hat, Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author: Alexander Larsson <alexl@redhat.com>
19 */
20
21#ifndef __G_FILE_H__
22#define __G_FILE_H__
23
24#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25#error "Only <gio/gio.h> can be included directly."
26#endif
27
28#include <gio/giotypes.h>
29
30G_BEGIN_DECLS
31
32#define G_TYPE_FILE (g_file_get_type ())
33#define G_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
34#define G_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
35#define G_FILE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
36
37#if 0
38/**
39 * GFile:
40 *
41 * A handle to an object implementing the #GFileIface interface.
42 * Generally stores a location within the file system. Handles do not
43 * necessarily represent files or directories that currently exist.
44 **/
45typedef struct _GFile GFile; /* Dummy typedef */
46#endif
47typedef struct _GFileIface GFileIface;
48
49
50/**
51 * GFileIface:
52 * @g_iface: The parent interface.
53 * @dup: Duplicates a #GFile.
54 * @hash: Creates a hash of a #GFile.
55 * @equal: Checks equality of two given #GFiles.
56 * @is_native: Checks to see if a file is native to the system.
57 * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
58 * @get_uri_scheme: Gets the URI scheme for a #GFile.
59 * @get_basename: Gets the basename for a given #GFile.
60 * @get_path: Gets the current path within a #GFile.
61 * @get_uri: Gets a URI for the path within a #GFile.
62 * @get_parse_name: Gets the parsed name for the #GFile.
63 * @get_parent: Gets the parent directory for the #GFile.
64 * @prefix_matches: Checks whether a #GFile contains a specified file.
65 * @get_relative_path: Gets the path for a #GFile relative to a given path.
66 * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
67 * @get_child_for_display_name: Gets the child #GFile for a given display name.
68 * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
69 * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
70 * @enumerate_children_finish: Finishes asynchronously enumerating the children.
71 * @query_info: Gets the #GFileInfo for a #GFile.
72 * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
73 * @query_info_finish: Finishes an asynchronous query info operation.
74 * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
75 * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
76 * @query_filesystem_info_finish: Finishes asynchronously getting the file system info.
77 * @find_enclosing_mount: Gets a #GMount for the #GFile.
78 * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile.
79 * @find_enclosing_mount_finish: Finishes asynchronously getting the volume.
80 * @set_display_name: Sets the display name for a #GFile.
81 * @set_display_name_async: Asynchronously sets a #GFile's display name.
82 * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
83 * @query_settable_attributes: Returns a list of #GFileAttributeInfos that can be set.
84 * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttributeInfos that can be set.
85 * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
86 * @query_writable_namespaces: Returns a list of #GFileAttributeInfo namespaces that are writable.
87 * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttributeInfo namespaces that are writable.
88 * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
89 * @set_attribute: Sets a #GFileAttributeInfo.
90 * @set_attributes_from_info: Sets a #GFileAttributeInfo with information from a #GFileInfo.
91 * @set_attributes_async: Asynchronously sets a file's attributes.
92 * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
93 * @read_fn: Reads a file asynchronously.
94 * @read_async: Asynchronously reads a file.
95 * @read_finish: Finishes asynchronously reading a file.
96 * @append_to: Writes to the end of a file.
97 * @append_to_async: Asynchronously writes to the end of a file.
98 * @append_to_finish: Finishes an asynchronous file append operation.
99 * @create: Creates a new file.
100 * @create_async: Asynchronously creates a file.
101 * @create_finish: Finishes asynchronously creating a file.
102 * @replace: Replaces the contents of a file.
103 * @replace_async: Asynchronously replaces the contents of a file.
104 * @replace_finish: Finishes asynchronously replacing a file.
105 * @delete_file: Deletes a file.
106 * @delete_file_async: Asynchronously deletes a file.
107 * @delete_file_finish: Finishes an asynchronous delete.
108 * @trash: Sends a #GFile to the Trash location.
109 * @trash_async: Asynchronously sends a #GFile to the Trash location.
110 * @trash_finish: Finishes an asynchronous file trashing operation.
111 * @make_directory: Makes a directory.
112 * @make_directory_async: Asynchronously makes a directory.
113 * @make_directory_finish: Finishes making a directory asynchronously.
114 * @make_symbolic_link: (nullable): Makes a symbolic link. %NULL if symbolic
115 * links are unsupported.
116 * @_make_symbolic_link_async: Asynchronously makes a symbolic link
117 * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
118 * @copy: (nullable): Copies a file. %NULL if copying is unsupported, which will
119 * cause `GFile` to use a fallback copy method where it reads from the
120 * source and writes to the destination.
121 * @copy_async: Asynchronously copies a file.
122 * @copy_finish: Finishes an asynchronous copy operation.
123 * @move: Moves a file.
124 * @move_async: Asynchronously moves a file. Since: 2.72
125 * @move_finish: Finishes an asynchronous move operation. Since: 2.72
126 * @mount_mountable: Mounts a mountable object.
127 * @mount_mountable_finish: Finishes a mounting operation.
128 * @unmount_mountable: Unmounts a mountable object.
129 * @unmount_mountable_finish: Finishes an unmount operation.
130 * @eject_mountable: Ejects a mountable.
131 * @eject_mountable_finish: Finishes an eject operation.
132 * @mount_enclosing_volume: Mounts a specified location.
133 * @mount_enclosing_volume_finish: Finishes mounting a specified location.
134 * @monitor_dir: Creates a #GFileMonitor for the location.
135 * @monitor_file: Creates a #GFileMonitor for the location.
136 * @open_readwrite: Open file read/write. Since 2.22.
137 * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
138 * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
139 * @create_readwrite: Creates file read/write. Since 2.22.
140 * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
141 * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
142 * @replace_readwrite: Replaces file read/write. Since 2.22.
143 * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
144 * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
145 * @start_mountable: Starts a mountable object. Since 2.22.
146 * @start_mountable_finish: Finishes a start operation. Since 2.22.
147 * @stop_mountable: Stops a mountable. Since 2.22.
148 * @stop_mountable_finish: Finishes a stop operation. Since 2.22.
149 * @supports_thread_contexts: a boolean that indicates whether the #GFile implementation supports thread-default contexts. Since 2.22.
150 * @unmount_mountable_with_operation: Unmounts a mountable object using a #GMountOperation. Since 2.22.
151 * @unmount_mountable_with_operation_finish: Finishes an unmount operation using a #GMountOperation. Since 2.22.
152 * @eject_mountable_with_operation: Ejects a mountable object using a #GMountOperation. Since 2.22.
153 * @eject_mountable_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
154 * @poll_mountable: Polls a mountable object for media changes. Since 2.22.
155 * @poll_mountable_finish: Finishes a poll operation for media changes. Since 2.22.
156 * @measure_disk_usage: Recursively measures the disk usage of @file. Since 2.38
157 * @measure_disk_usage_async: Asynchronously recursively measures the disk usage of @file. Since 2.38
158 * @measure_disk_usage_finish: Finishes an asynchronous recursive measurement of the disk usage of @file. Since 2.38
159 *
160 * An interface for writing VFS file handles.
161 **/
162struct _GFileIface
163{
164 GTypeInterface g_iface;
165
166 /* Virtual Table */
167
168 GFile * (* dup) (GFile *file);
169 guint (* hash) (GFile *file);
170 gboolean (* equal) (GFile *file1,
171 GFile *file2);
172 gboolean (* is_native) (GFile *file);
173 gboolean (* has_uri_scheme) (GFile *file,
174 const char *uri_scheme);
175 char * (* get_uri_scheme) (GFile *file);
176 char * (* get_basename) (GFile *file);
177 char * (* get_path) (GFile *file);
178 char * (* get_uri) (GFile *file);
179 char * (* get_parse_name) (GFile *file);
180 GFile * (* get_parent) (GFile *file);
181 gboolean (* prefix_matches) (GFile *prefix,
182 GFile *file);
183 char * (* get_relative_path) (GFile *parent,
184 GFile *descendant);
185 GFile * (* resolve_relative_path) (GFile *file,
186 const char *relative_path);
187 GFile * (* get_child_for_display_name) (GFile *file,
188 const char *display_name,
189 GError **error);
190
191 GFileEnumerator * (* enumerate_children) (GFile *file,
192 const char *attributes,
193 GFileQueryInfoFlags flags,
194 GCancellable *cancellable,
195 GError **error);
196 void (* enumerate_children_async) (GFile *file,
197 const char *attributes,
198 GFileQueryInfoFlags flags,
199 int io_priority,
200 GCancellable *cancellable,
201 GAsyncReadyCallback callback,
202 gpointer user_data);
203 GFileEnumerator * (* enumerate_children_finish) (GFile *file,
204 GAsyncResult *res,
205 GError **error);
206
207 GFileInfo * (* query_info) (GFile *file,
208 const char *attributes,
209 GFileQueryInfoFlags flags,
210 GCancellable *cancellable,
211 GError **error);
212 void (* query_info_async) (GFile *file,
213 const char *attributes,
214 GFileQueryInfoFlags flags,
215 int io_priority,
216 GCancellable *cancellable,
217 GAsyncReadyCallback callback,
218 gpointer user_data);
219 GFileInfo * (* query_info_finish) (GFile *file,
220 GAsyncResult *res,
221 GError **error);
222
223 GFileInfo * (* query_filesystem_info) (GFile *file,
224 const char *attributes,
225 GCancellable *cancellable,
226 GError **error);
227 void (* query_filesystem_info_async) (GFile *file,
228 const char *attributes,
229 int io_priority,
230 GCancellable *cancellable,
231 GAsyncReadyCallback callback,
232 gpointer user_data);
233 GFileInfo * (* query_filesystem_info_finish)(GFile *file,
234 GAsyncResult *res,
235 GError **error);
236
237 GMount * (* find_enclosing_mount) (GFile *file,
238 GCancellable *cancellable,
239 GError **error);
240 void (* find_enclosing_mount_async) (GFile *file,
241 int io_priority,
242 GCancellable *cancellable,
243 GAsyncReadyCallback callback,
244 gpointer user_data);
245 GMount * (* find_enclosing_mount_finish) (GFile *file,
246 GAsyncResult *res,
247 GError **error);
248
249 GFile * (* set_display_name) (GFile *file,
250 const char *display_name,
251 GCancellable *cancellable,
252 GError **error);
253 void (* set_display_name_async) (GFile *file,
254 const char *display_name,
255 int io_priority,
256 GCancellable *cancellable,
257 GAsyncReadyCallback callback,
258 gpointer user_data);
259 GFile * (* set_display_name_finish) (GFile *file,
260 GAsyncResult *res,
261 GError **error);
262
263 GFileAttributeInfoList * (* query_settable_attributes) (GFile *file,
264 GCancellable *cancellable,
265 GError **error);
266 void (* _query_settable_attributes_async) (void);
267 void (* _query_settable_attributes_finish) (void);
268
269 GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file,
270 GCancellable *cancellable,
271 GError **error);
272 void (* _query_writable_namespaces_async) (void);
273 void (* _query_writable_namespaces_finish) (void);
274
275 gboolean (* set_attribute) (GFile *file,
276 const char *attribute,
277 GFileAttributeType type,
278 gpointer value_p,
279 GFileQueryInfoFlags flags,
280 GCancellable *cancellable,
281 GError **error);
282 gboolean (* set_attributes_from_info) (GFile *file,
283 GFileInfo *info,
284 GFileQueryInfoFlags flags,
285 GCancellable *cancellable,
286 GError **error);
287 void (* set_attributes_async) (GFile *file,
288 GFileInfo *info,
289 GFileQueryInfoFlags flags,
290 int io_priority,
291 GCancellable *cancellable,
292 GAsyncReadyCallback callback,
293 gpointer user_data);
294 gboolean (* set_attributes_finish) (GFile *file,
295 GAsyncResult *result,
296 GFileInfo **info,
297 GError **error);
298
299 GFileInputStream * (* read_fn) (GFile *file,
300 GCancellable *cancellable,
301 GError **error);
302 void (* read_async) (GFile *file,
303 int io_priority,
304 GCancellable *cancellable,
305 GAsyncReadyCallback callback,
306 gpointer user_data);
307 GFileInputStream * (* read_finish) (GFile *file,
308 GAsyncResult *res,
309 GError **error);
310
311 GFileOutputStream * (* append_to) (GFile *file,
312 GFileCreateFlags flags,
313 GCancellable *cancellable,
314 GError **error);
315 void (* append_to_async) (GFile *file,
316 GFileCreateFlags flags,
317 int io_priority,
318 GCancellable *cancellable,
319 GAsyncReadyCallback callback,
320 gpointer user_data);
321 GFileOutputStream * (* append_to_finish) (GFile *file,
322 GAsyncResult *res,
323 GError **error);
324
325 GFileOutputStream * (* create) (GFile *file,
326 GFileCreateFlags flags,
327 GCancellable *cancellable,
328 GError **error);
329 void (* create_async) (GFile *file,
330 GFileCreateFlags flags,
331 int io_priority,
332 GCancellable *cancellable,
333 GAsyncReadyCallback callback,
334 gpointer user_data);
335 GFileOutputStream * (* create_finish) (GFile *file,
336 GAsyncResult *res,
337 GError **error);
338
339 GFileOutputStream * (* replace) (GFile *file,
340 const char *etag,
341 gboolean make_backup,
342 GFileCreateFlags flags,
343 GCancellable *cancellable,
344 GError **error);
345 void (* replace_async) (GFile *file,
346 const char *etag,
347 gboolean make_backup,
348 GFileCreateFlags flags,
349 int io_priority,
350 GCancellable *cancellable,
351 GAsyncReadyCallback callback,
352 gpointer user_data);
353 GFileOutputStream * (* replace_finish) (GFile *file,
354 GAsyncResult *res,
355 GError **error);
356
357 gboolean (* delete_file) (GFile *file,
358 GCancellable *cancellable,
359 GError **error);
360 void (* delete_file_async) (GFile *file,
361 int io_priority,
362 GCancellable *cancellable,
363 GAsyncReadyCallback callback,
364 gpointer user_data);
365 gboolean (* delete_file_finish) (GFile *file,
366 GAsyncResult *result,
367 GError **error);
368
369 gboolean (* trash) (GFile *file,
370 GCancellable *cancellable,
371 GError **error);
372 void (* trash_async) (GFile *file,
373 int io_priority,
374 GCancellable *cancellable,
375 GAsyncReadyCallback callback,
376 gpointer user_data);
377 gboolean (* trash_finish) (GFile *file,
378 GAsyncResult *result,
379 GError **error);
380
381 gboolean (* make_directory) (GFile *file,
382 GCancellable *cancellable,
383 GError **error);
384 void (* make_directory_async) (GFile *file,
385 int io_priority,
386 GCancellable *cancellable,
387 GAsyncReadyCallback callback,
388 gpointer user_data);
389 gboolean (* make_directory_finish) (GFile *file,
390 GAsyncResult *result,
391 GError **error);
392
393 gboolean (* make_symbolic_link) (GFile *file,
394 const char *symlink_value,
395 GCancellable *cancellable,
396 GError **error);
397 void (* _make_symbolic_link_async) (void);
398 void (* _make_symbolic_link_finish) (void);
399
400 gboolean (* copy) (GFile *source,
401 GFile *destination,
402 GFileCopyFlags flags,
403 GCancellable *cancellable,
404 GFileProgressCallback progress_callback,
405 gpointer progress_callback_data,
406 GError **error);
407 void (* copy_async) (GFile *source,
408 GFile *destination,
409 GFileCopyFlags flags,
410 int io_priority,
411 GCancellable *cancellable,
412 GFileProgressCallback progress_callback,
413 gpointer progress_callback_data,
414 GAsyncReadyCallback callback,
415 gpointer user_data);
416 gboolean (* copy_finish) (GFile *file,
417 GAsyncResult *res,
418 GError **error);
419
420 gboolean (* move) (GFile *source,
421 GFile *destination,
422 GFileCopyFlags flags,
423 GCancellable *cancellable,
424 GFileProgressCallback progress_callback,
425 gpointer progress_callback_data,
426 GError **error);
427 void (* move_async) (GFile *source,
428 GFile *destination,
429 GFileCopyFlags flags,
430 int io_priority,
431 GCancellable *cancellable,
432 GFileProgressCallback progress_callback,
433 gpointer progress_callback_data,
434 GAsyncReadyCallback callback,
435 gpointer user_data);
436 gboolean (* move_finish) (GFile *file,
437 GAsyncResult *result,
438 GError **error);
439
440 void (* mount_mountable) (GFile *file,
441 GMountMountFlags flags,
442 GMountOperation *mount_operation,
443 GCancellable *cancellable,
444 GAsyncReadyCallback callback,
445 gpointer user_data);
446 GFile * (* mount_mountable_finish) (GFile *file,
447 GAsyncResult *result,
448 GError **error);
449
450 void (* unmount_mountable) (GFile *file,
451 GMountUnmountFlags flags,
452 GCancellable *cancellable,
453 GAsyncReadyCallback callback,
454 gpointer user_data);
455 gboolean (* unmount_mountable_finish) (GFile *file,
456 GAsyncResult *result,
457 GError **error);
458
459 void (* eject_mountable) (GFile *file,
460 GMountUnmountFlags flags,
461 GCancellable *cancellable,
462 GAsyncReadyCallback callback,
463 gpointer user_data);
464 gboolean (* eject_mountable_finish) (GFile *file,
465 GAsyncResult *result,
466 GError **error);
467
468 void (* mount_enclosing_volume) (GFile *location,
469 GMountMountFlags flags,
470 GMountOperation *mount_operation,
471 GCancellable *cancellable,
472 GAsyncReadyCallback callback,
473 gpointer user_data);
474 gboolean (* mount_enclosing_volume_finish) (GFile *location,
475 GAsyncResult *result,
476 GError **error);
477
478 GFileMonitor * (* monitor_dir) (GFile *file,
479 GFileMonitorFlags flags,
480 GCancellable *cancellable,
481 GError **error);
482 GFileMonitor * (* monitor_file) (GFile *file,
483 GFileMonitorFlags flags,
484 GCancellable *cancellable,
485 GError **error);
486
487 GFileIOStream * (* open_readwrite) (GFile *file,
488 GCancellable *cancellable,
489 GError **error);
490 void (* open_readwrite_async) (GFile *file,
491 int io_priority,
492 GCancellable *cancellable,
493 GAsyncReadyCallback callback,
494 gpointer user_data);
495 GFileIOStream * (* open_readwrite_finish) (GFile *file,
496 GAsyncResult *res,
497 GError **error);
498 GFileIOStream * (* create_readwrite) (GFile *file,
499 GFileCreateFlags flags,
500 GCancellable *cancellable,
501 GError **error);
502 void (* create_readwrite_async) (GFile *file,
503 GFileCreateFlags flags,
504 int io_priority,
505 GCancellable *cancellable,
506 GAsyncReadyCallback callback,
507 gpointer user_data);
508 GFileIOStream * (* create_readwrite_finish) (GFile *file,
509 GAsyncResult *res,
510 GError **error);
511 GFileIOStream * (* replace_readwrite) (GFile *file,
512 const char *etag,
513 gboolean make_backup,
514 GFileCreateFlags flags,
515 GCancellable *cancellable,
516 GError **error);
517 void (* replace_readwrite_async) (GFile *file,
518 const char *etag,
519 gboolean make_backup,
520 GFileCreateFlags flags,
521 int io_priority,
522 GCancellable *cancellable,
523 GAsyncReadyCallback callback,
524 gpointer user_data);
525 GFileIOStream * (* replace_readwrite_finish) (GFile *file,
526 GAsyncResult *res,
527 GError **error);
528
529 void (* start_mountable) (GFile *file,
530 GDriveStartFlags flags,
531 GMountOperation *start_operation,
532 GCancellable *cancellable,
533 GAsyncReadyCallback callback,
534 gpointer user_data);
535 gboolean (* start_mountable_finish) (GFile *file,
536 GAsyncResult *result,
537 GError **error);
538
539 void (* stop_mountable) (GFile *file,
540 GMountUnmountFlags flags,
541 GMountOperation *mount_operation,
542 GCancellable *cancellable,
543 GAsyncReadyCallback callback,
544 gpointer user_data);
545 gboolean (* stop_mountable_finish) (GFile *file,
546 GAsyncResult *result,
547 GError **error);
548
549 gboolean supports_thread_contexts;
550
551 void (* unmount_mountable_with_operation) (GFile *file,
552 GMountUnmountFlags flags,
553 GMountOperation *mount_operation,
554 GCancellable *cancellable,
555 GAsyncReadyCallback callback,
556 gpointer user_data);
557 gboolean (* unmount_mountable_with_operation_finish) (GFile *file,
558 GAsyncResult *result,
559 GError **error);
560
561 void (* eject_mountable_with_operation) (GFile *file,
562 GMountUnmountFlags flags,
563 GMountOperation *mount_operation,
564 GCancellable *cancellable,
565 GAsyncReadyCallback callback,
566 gpointer user_data);
567 gboolean (* eject_mountable_with_operation_finish) (GFile *file,
568 GAsyncResult *result,
569 GError **error);
570
571 void (* poll_mountable) (GFile *file,
572 GCancellable *cancellable,
573 GAsyncReadyCallback callback,
574 gpointer user_data);
575 gboolean (* poll_mountable_finish) (GFile *file,
576 GAsyncResult *result,
577 GError **error);
578
579 gboolean (* measure_disk_usage) (GFile *file,
580 GFileMeasureFlags flags,
581 GCancellable *cancellable,
582 GFileMeasureProgressCallback progress_callback,
583 gpointer progress_data,
584 guint64 *disk_usage,
585 guint64 *num_dirs,
586 guint64 *num_files,
587 GError **error);
588 void (* measure_disk_usage_async) (GFile *file,
589 GFileMeasureFlags flags,
590 gint io_priority,
591 GCancellable *cancellable,
592 GFileMeasureProgressCallback progress_callback,
593 gpointer progress_data,
594 GAsyncReadyCallback callback,
595 gpointer user_data);
596 gboolean (* measure_disk_usage_finish) (GFile *file,
597 GAsyncResult *result,
598 guint64 *disk_usage,
599 guint64 *num_dirs,
600 guint64 *num_files,
601 GError **error);
602};
603
604GLIB_AVAILABLE_IN_ALL
605GType g_file_get_type (void) G_GNUC_CONST;
606
607GLIB_AVAILABLE_IN_ALL
608GFile * g_file_new_for_path (const char *path);
609GLIB_AVAILABLE_IN_ALL
610GFile * g_file_new_for_uri (const char *uri);
611GLIB_AVAILABLE_IN_ALL
612GFile * g_file_new_for_commandline_arg (const char *arg);
613GLIB_AVAILABLE_IN_2_36
614GFile * g_file_new_for_commandline_arg_and_cwd (const gchar *arg,
615 const gchar *cwd);
616GLIB_AVAILABLE_IN_2_32
617GFile * g_file_new_tmp (const char *tmpl,
618 GFileIOStream **iostream,
619 GError **error);
620GLIB_AVAILABLE_IN_ALL
621GFile * g_file_parse_name (const char *parse_name);
622GLIB_AVAILABLE_IN_2_56
623GFile * g_file_new_build_filename (const gchar *first_element,
624 ...) G_GNUC_NULL_TERMINATED;
625GLIB_AVAILABLE_IN_ALL
626GFile * g_file_dup (GFile *file);
627GLIB_AVAILABLE_IN_ALL
628guint g_file_hash (gconstpointer file);
629GLIB_AVAILABLE_IN_ALL
630gboolean g_file_equal (GFile *file1,
631 GFile *file2);
632GLIB_AVAILABLE_IN_ALL
633char * g_file_get_basename (GFile *file);
634GLIB_AVAILABLE_IN_ALL
635char * g_file_get_path (GFile *file);
636GLIB_AVAILABLE_IN_2_56
637const char * g_file_peek_path (GFile *file);
638GLIB_AVAILABLE_IN_ALL
639char * g_file_get_uri (GFile *file);
640GLIB_AVAILABLE_IN_ALL
641char * g_file_get_parse_name (GFile *file);
642GLIB_AVAILABLE_IN_ALL
643GFile * g_file_get_parent (GFile *file);
644GLIB_AVAILABLE_IN_ALL
645gboolean g_file_has_parent (GFile *file,
646 GFile *parent);
647GLIB_AVAILABLE_IN_ALL
648GFile * g_file_get_child (GFile *file,
649 const char *name);
650GLIB_AVAILABLE_IN_ALL
651GFile * g_file_get_child_for_display_name (GFile *file,
652 const char *display_name,
653 GError **error);
654GLIB_AVAILABLE_IN_ALL
655gboolean g_file_has_prefix (GFile *file,
656 GFile *prefix);
657GLIB_AVAILABLE_IN_ALL
658char * g_file_get_relative_path (GFile *parent,
659 GFile *descendant);
660GLIB_AVAILABLE_IN_ALL
661GFile * g_file_resolve_relative_path (GFile *file,
662 const char *relative_path);
663GLIB_AVAILABLE_IN_ALL
664gboolean g_file_is_native (GFile *file);
665GLIB_AVAILABLE_IN_ALL
666gboolean g_file_has_uri_scheme (GFile *file,
667 const char *uri_scheme);
668GLIB_AVAILABLE_IN_ALL
669char * g_file_get_uri_scheme (GFile *file);
670GLIB_AVAILABLE_IN_ALL
671GFileInputStream * g_file_read (GFile *file,
672 GCancellable *cancellable,
673 GError **error);
674GLIB_AVAILABLE_IN_ALL
675void g_file_read_async (GFile *file,
676 int io_priority,
677 GCancellable *cancellable,
678 GAsyncReadyCallback callback,
679 gpointer user_data);
680GLIB_AVAILABLE_IN_ALL
681GFileInputStream * g_file_read_finish (GFile *file,
682 GAsyncResult *res,
683 GError **error);
684GLIB_AVAILABLE_IN_ALL
685GFileOutputStream * g_file_append_to (GFile *file,
686 GFileCreateFlags flags,
687 GCancellable *cancellable,
688 GError **error);
689GLIB_AVAILABLE_IN_ALL
690GFileOutputStream * g_file_create (GFile *file,
691 GFileCreateFlags flags,
692 GCancellable *cancellable,
693 GError **error);
694GLIB_AVAILABLE_IN_ALL
695GFileOutputStream * g_file_replace (GFile *file,
696 const char *etag,
697 gboolean make_backup,
698 GFileCreateFlags flags,
699 GCancellable *cancellable,
700 GError **error);
701GLIB_AVAILABLE_IN_ALL
702void g_file_append_to_async (GFile *file,
703 GFileCreateFlags flags,
704 int io_priority,
705 GCancellable *cancellable,
706 GAsyncReadyCallback callback,
707 gpointer user_data);
708GLIB_AVAILABLE_IN_ALL
709GFileOutputStream * g_file_append_to_finish (GFile *file,
710 GAsyncResult *res,
711 GError **error);
712GLIB_AVAILABLE_IN_ALL
713void g_file_create_async (GFile *file,
714 GFileCreateFlags flags,
715 int io_priority,
716 GCancellable *cancellable,
717 GAsyncReadyCallback callback,
718 gpointer user_data);
719GLIB_AVAILABLE_IN_ALL
720GFileOutputStream * g_file_create_finish (GFile *file,
721 GAsyncResult *res,
722 GError **error);
723GLIB_AVAILABLE_IN_ALL
724void g_file_replace_async (GFile *file,
725 const char *etag,
726 gboolean make_backup,
727 GFileCreateFlags flags,
728 int io_priority,
729 GCancellable *cancellable,
730 GAsyncReadyCallback callback,
731 gpointer user_data);
732GLIB_AVAILABLE_IN_ALL
733GFileOutputStream * g_file_replace_finish (GFile *file,
734 GAsyncResult *res,
735 GError **error);
736GLIB_AVAILABLE_IN_ALL
737GFileIOStream * g_file_open_readwrite (GFile *file,
738 GCancellable *cancellable,
739 GError **error);
740GLIB_AVAILABLE_IN_ALL
741void g_file_open_readwrite_async (GFile *file,
742 int io_priority,
743 GCancellable *cancellable,
744 GAsyncReadyCallback callback,
745 gpointer user_data);
746GLIB_AVAILABLE_IN_ALL
747GFileIOStream * g_file_open_readwrite_finish (GFile *file,
748 GAsyncResult *res,
749 GError **error);
750GLIB_AVAILABLE_IN_ALL
751GFileIOStream * g_file_create_readwrite (GFile *file,
752 GFileCreateFlags flags,
753 GCancellable *cancellable,
754 GError **error);
755GLIB_AVAILABLE_IN_ALL
756void g_file_create_readwrite_async (GFile *file,
757 GFileCreateFlags flags,
758 int io_priority,
759 GCancellable *cancellable,
760 GAsyncReadyCallback callback,
761 gpointer user_data);
762GLIB_AVAILABLE_IN_ALL
763GFileIOStream * g_file_create_readwrite_finish (GFile *file,
764 GAsyncResult *res,
765 GError **error);
766GLIB_AVAILABLE_IN_ALL
767GFileIOStream * g_file_replace_readwrite (GFile *file,
768 const char *etag,
769 gboolean make_backup,
770 GFileCreateFlags flags,
771 GCancellable *cancellable,
772 GError **error);
773GLIB_AVAILABLE_IN_ALL
774void g_file_replace_readwrite_async (GFile *file,
775 const char *etag,
776 gboolean make_backup,
777 GFileCreateFlags flags,
778 int io_priority,
779 GCancellable *cancellable,
780 GAsyncReadyCallback callback,
781 gpointer user_data);
782GLIB_AVAILABLE_IN_ALL
783GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
784 GAsyncResult *res,
785 GError **error);
786GLIB_AVAILABLE_IN_ALL
787gboolean g_file_query_exists (GFile *file,
788 GCancellable *cancellable);
789GLIB_AVAILABLE_IN_ALL
790GFileType g_file_query_file_type (GFile *file,
791 GFileQueryInfoFlags flags,
792 GCancellable *cancellable);
793GLIB_AVAILABLE_IN_ALL
794GFileInfo * g_file_query_info (GFile *file,
795 const char *attributes,
796 GFileQueryInfoFlags flags,
797 GCancellable *cancellable,
798 GError **error);
799GLIB_AVAILABLE_IN_ALL
800void g_file_query_info_async (GFile *file,
801 const char *attributes,
802 GFileQueryInfoFlags flags,
803 int io_priority,
804 GCancellable *cancellable,
805 GAsyncReadyCallback callback,
806 gpointer user_data);
807GLIB_AVAILABLE_IN_ALL
808GFileInfo * g_file_query_info_finish (GFile *file,
809 GAsyncResult *res,
810 GError **error);
811GLIB_AVAILABLE_IN_ALL
812GFileInfo * g_file_query_filesystem_info (GFile *file,
813 const char *attributes,
814 GCancellable *cancellable,
815 GError **error);
816GLIB_AVAILABLE_IN_ALL
817void g_file_query_filesystem_info_async (GFile *file,
818 const char *attributes,
819 int io_priority,
820 GCancellable *cancellable,
821 GAsyncReadyCallback callback,
822 gpointer user_data);
823GLIB_AVAILABLE_IN_ALL
824GFileInfo * g_file_query_filesystem_info_finish (GFile *file,
825 GAsyncResult *res,
826 GError **error);
827GLIB_AVAILABLE_IN_ALL
828GMount * g_file_find_enclosing_mount (GFile *file,
829 GCancellable *cancellable,
830 GError **error);
831GLIB_AVAILABLE_IN_ALL
832void g_file_find_enclosing_mount_async (GFile *file,
833 int io_priority,
834 GCancellable *cancellable,
835 GAsyncReadyCallback callback,
836 gpointer user_data);
837GLIB_AVAILABLE_IN_ALL
838GMount * g_file_find_enclosing_mount_finish (GFile *file,
839 GAsyncResult *res,
840 GError **error);
841GLIB_AVAILABLE_IN_ALL
842GFileEnumerator * g_file_enumerate_children (GFile *file,
843 const char *attributes,
844 GFileQueryInfoFlags flags,
845 GCancellable *cancellable,
846 GError **error);
847GLIB_AVAILABLE_IN_ALL
848void g_file_enumerate_children_async (GFile *file,
849 const char *attributes,
850 GFileQueryInfoFlags flags,
851 int io_priority,
852 GCancellable *cancellable,
853 GAsyncReadyCallback callback,
854 gpointer user_data);
855GLIB_AVAILABLE_IN_ALL
856GFileEnumerator * g_file_enumerate_children_finish (GFile *file,
857 GAsyncResult *res,
858 GError **error);
859GLIB_AVAILABLE_IN_ALL
860GFile * g_file_set_display_name (GFile *file,
861 const char *display_name,
862 GCancellable *cancellable,
863 GError **error);
864GLIB_AVAILABLE_IN_ALL
865void g_file_set_display_name_async (GFile *file,
866 const char *display_name,
867 int io_priority,
868 GCancellable *cancellable,
869 GAsyncReadyCallback callback,
870 gpointer user_data);
871GLIB_AVAILABLE_IN_ALL
872GFile * g_file_set_display_name_finish (GFile *file,
873 GAsyncResult *res,
874 GError **error);
875GLIB_AVAILABLE_IN_ALL
876gboolean g_file_delete (GFile *file,
877 GCancellable *cancellable,
878 GError **error);
879
880GLIB_AVAILABLE_IN_2_34
881void g_file_delete_async (GFile *file,
882 int io_priority,
883 GCancellable *cancellable,
884 GAsyncReadyCallback callback,
885 gpointer user_data);
886
887GLIB_AVAILABLE_IN_2_34
888gboolean g_file_delete_finish (GFile *file,
889 GAsyncResult *result,
890 GError **error);
891
892GLIB_AVAILABLE_IN_ALL
893gboolean g_file_trash (GFile *file,
894 GCancellable *cancellable,
895 GError **error);
896
897GLIB_AVAILABLE_IN_2_38
898void g_file_trash_async (GFile *file,
899 int io_priority,
900 GCancellable *cancellable,
901 GAsyncReadyCallback callback,
902 gpointer user_data);
903
904GLIB_AVAILABLE_IN_2_38
905gboolean g_file_trash_finish (GFile *file,
906 GAsyncResult *result,
907 GError **error);
908
909GLIB_AVAILABLE_IN_ALL
910gboolean g_file_copy (GFile *source,
911 GFile *destination,
912 GFileCopyFlags flags,
913 GCancellable *cancellable,
914 GFileProgressCallback progress_callback,
915 gpointer progress_callback_data,
916 GError **error);
917GLIB_AVAILABLE_IN_ALL
918void g_file_copy_async (GFile *source,
919 GFile *destination,
920 GFileCopyFlags flags,
921 int io_priority,
922 GCancellable *cancellable,
923 GFileProgressCallback progress_callback,
924 gpointer progress_callback_data,
925 GAsyncReadyCallback callback,
926 gpointer user_data);
927GLIB_AVAILABLE_IN_ALL
928gboolean g_file_copy_finish (GFile *file,
929 GAsyncResult *res,
930 GError **error);
931GLIB_AVAILABLE_IN_ALL
932gboolean g_file_move (GFile *source,
933 GFile *destination,
934 GFileCopyFlags flags,
935 GCancellable *cancellable,
936 GFileProgressCallback progress_callback,
937 gpointer progress_callback_data,
938 GError **error);
939GLIB_AVAILABLE_IN_2_72
940void g_file_move_async (GFile *source,
941 GFile *destination,
942 GFileCopyFlags flags,
943 int io_priority,
944 GCancellable *cancellable,
945 GFileProgressCallback progress_callback,
946 gpointer progress_callback_data,
947 GAsyncReadyCallback callback,
948 gpointer user_data);
949GLIB_AVAILABLE_IN_2_72
950gboolean g_file_move_finish (GFile *file,
951 GAsyncResult *result,
952 GError **error);
953GLIB_AVAILABLE_IN_ALL
954gboolean g_file_make_directory (GFile *file,
955 GCancellable *cancellable,
956 GError **error);
957GLIB_AVAILABLE_IN_2_38
958void g_file_make_directory_async (GFile *file,
959 int io_priority,
960 GCancellable *cancellable,
961 GAsyncReadyCallback callback,
962 gpointer user_data);
963GLIB_AVAILABLE_IN_2_38
964gboolean g_file_make_directory_finish (GFile *file,
965 GAsyncResult *result,
966 GError **error);
967
968GLIB_AVAILABLE_IN_ALL
969gboolean g_file_make_directory_with_parents (GFile *file,
970 GCancellable *cancellable,
971 GError **error);
972GLIB_AVAILABLE_IN_ALL
973gboolean g_file_make_symbolic_link (GFile *file,
974 const char *symlink_value,
975 GCancellable *cancellable,
976 GError **error);
977GLIB_AVAILABLE_IN_ALL
978GFileAttributeInfoList *g_file_query_settable_attributes (GFile *file,
979 GCancellable *cancellable,
980 GError **error);
981GLIB_AVAILABLE_IN_ALL
982GFileAttributeInfoList *g_file_query_writable_namespaces (GFile *file,
983 GCancellable *cancellable,
984 GError **error);
985GLIB_AVAILABLE_IN_ALL
986gboolean g_file_set_attribute (GFile *file,
987 const char *attribute,
988 GFileAttributeType type,
989 gpointer value_p,
990 GFileQueryInfoFlags flags,
991 GCancellable *cancellable,
992 GError **error);
993GLIB_AVAILABLE_IN_ALL
994gboolean g_file_set_attributes_from_info (GFile *file,
995 GFileInfo *info,
996 GFileQueryInfoFlags flags,
997 GCancellable *cancellable,
998 GError **error);
999GLIB_AVAILABLE_IN_ALL
1000void g_file_set_attributes_async (GFile *file,
1001 GFileInfo *info,
1002 GFileQueryInfoFlags flags,
1003 int io_priority,
1004 GCancellable *cancellable,
1005 GAsyncReadyCallback callback,
1006 gpointer user_data);
1007GLIB_AVAILABLE_IN_ALL
1008gboolean g_file_set_attributes_finish (GFile *file,
1009 GAsyncResult *result,
1010 GFileInfo **info,
1011 GError **error);
1012GLIB_AVAILABLE_IN_ALL
1013gboolean g_file_set_attribute_string (GFile *file,
1014 const char *attribute,
1015 const char *value,
1016 GFileQueryInfoFlags flags,
1017 GCancellable *cancellable,
1018 GError **error);
1019GLIB_AVAILABLE_IN_ALL
1020gboolean g_file_set_attribute_byte_string (GFile *file,
1021 const char *attribute,
1022 const char *value,
1023 GFileQueryInfoFlags flags,
1024 GCancellable *cancellable,
1025 GError **error);
1026GLIB_AVAILABLE_IN_ALL
1027gboolean g_file_set_attribute_uint32 (GFile *file,
1028 const char *attribute,
1029 guint32 value,
1030 GFileQueryInfoFlags flags,
1031 GCancellable *cancellable,
1032 GError **error);
1033GLIB_AVAILABLE_IN_ALL
1034gboolean g_file_set_attribute_int32 (GFile *file,
1035 const char *attribute,
1036 gint32 value,
1037 GFileQueryInfoFlags flags,
1038 GCancellable *cancellable,
1039 GError **error);
1040GLIB_AVAILABLE_IN_ALL
1041gboolean g_file_set_attribute_uint64 (GFile *file,
1042 const char *attribute,
1043 guint64 value,
1044 GFileQueryInfoFlags flags,
1045 GCancellable *cancellable,
1046 GError **error);
1047GLIB_AVAILABLE_IN_ALL
1048gboolean g_file_set_attribute_int64 (GFile *file,
1049 const char *attribute,
1050 gint64 value,
1051 GFileQueryInfoFlags flags,
1052 GCancellable *cancellable,
1053 GError **error);
1054GLIB_AVAILABLE_IN_ALL
1055void g_file_mount_enclosing_volume (GFile *location,
1056 GMountMountFlags flags,
1057 GMountOperation *mount_operation,
1058 GCancellable *cancellable,
1059 GAsyncReadyCallback callback,
1060 gpointer user_data);
1061GLIB_AVAILABLE_IN_ALL
1062gboolean g_file_mount_enclosing_volume_finish (GFile *location,
1063 GAsyncResult *result,
1064 GError **error);
1065GLIB_AVAILABLE_IN_ALL
1066void g_file_mount_mountable (GFile *file,
1067 GMountMountFlags flags,
1068 GMountOperation *mount_operation,
1069 GCancellable *cancellable,
1070 GAsyncReadyCallback callback,
1071 gpointer user_data);
1072GLIB_AVAILABLE_IN_ALL
1073GFile * g_file_mount_mountable_finish (GFile *file,
1074 GAsyncResult *result,
1075 GError **error);
1076GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
1077void g_file_unmount_mountable (GFile *file,
1078 GMountUnmountFlags flags,
1079 GCancellable *cancellable,
1080 GAsyncReadyCallback callback,
1081 gpointer user_data);
1082
1083GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
1084gboolean g_file_unmount_mountable_finish (GFile *file,
1085 GAsyncResult *result,
1086 GError **error);
1087GLIB_AVAILABLE_IN_ALL
1088void g_file_unmount_mountable_with_operation (GFile *file,
1089 GMountUnmountFlags flags,
1090 GMountOperation *mount_operation,
1091 GCancellable *cancellable,
1092 GAsyncReadyCallback callback,
1093 gpointer user_data);
1094GLIB_AVAILABLE_IN_ALL
1095gboolean g_file_unmount_mountable_with_operation_finish (GFile *file,
1096 GAsyncResult *result,
1097 GError **error);
1098GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1099void g_file_eject_mountable (GFile *file,
1100 GMountUnmountFlags flags,
1101 GCancellable *cancellable,
1102 GAsyncReadyCallback callback,
1103 gpointer user_data);
1104
1105GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1106gboolean g_file_eject_mountable_finish (GFile *file,
1107 GAsyncResult *result,
1108 GError **error);
1109GLIB_AVAILABLE_IN_ALL
1110void g_file_eject_mountable_with_operation (GFile *file,
1111 GMountUnmountFlags flags,
1112 GMountOperation *mount_operation,
1113 GCancellable *cancellable,
1114 GAsyncReadyCallback callback,
1115 gpointer user_data);
1116GLIB_AVAILABLE_IN_ALL
1117gboolean g_file_eject_mountable_with_operation_finish (GFile *file,
1118 GAsyncResult *result,
1119 GError **error);
1120
1121GLIB_AVAILABLE_IN_2_68
1122char * g_file_build_attribute_list_for_copy (GFile *file,
1123 GFileCopyFlags flags,
1124 GCancellable *cancellable,
1125 GError **error);
1126
1127GLIB_AVAILABLE_IN_ALL
1128gboolean g_file_copy_attributes (GFile *source,
1129 GFile *destination,
1130 GFileCopyFlags flags,
1131 GCancellable *cancellable,
1132 GError **error);
1133
1134
1135GLIB_AVAILABLE_IN_ALL
1136GFileMonitor* g_file_monitor_directory (GFile *file,
1137 GFileMonitorFlags flags,
1138 GCancellable *cancellable,
1139 GError **error);
1140GLIB_AVAILABLE_IN_ALL
1141GFileMonitor* g_file_monitor_file (GFile *file,
1142 GFileMonitorFlags flags,
1143 GCancellable *cancellable,
1144 GError **error);
1145GLIB_AVAILABLE_IN_ALL
1146GFileMonitor* g_file_monitor (GFile *file,
1147 GFileMonitorFlags flags,
1148 GCancellable *cancellable,
1149 GError **error);
1150
1151GLIB_AVAILABLE_IN_2_38
1152gboolean g_file_measure_disk_usage (GFile *file,
1153 GFileMeasureFlags flags,
1154 GCancellable *cancellable,
1155 GFileMeasureProgressCallback progress_callback,
1156 gpointer progress_data,
1157 guint64 *disk_usage,
1158 guint64 *num_dirs,
1159 guint64 *num_files,
1160 GError **error);
1161
1162GLIB_AVAILABLE_IN_2_38
1163void g_file_measure_disk_usage_async (GFile *file,
1164 GFileMeasureFlags flags,
1165 gint io_priority,
1166 GCancellable *cancellable,
1167 GFileMeasureProgressCallback progress_callback,
1168 gpointer progress_data,
1169 GAsyncReadyCallback callback,
1170 gpointer user_data);
1171
1172GLIB_AVAILABLE_IN_2_38
1173gboolean g_file_measure_disk_usage_finish (GFile *file,
1174 GAsyncResult *result,
1175 guint64 *disk_usage,
1176 guint64 *num_dirs,
1177 guint64 *num_files,
1178 GError **error);
1179
1180GLIB_AVAILABLE_IN_ALL
1181void g_file_start_mountable (GFile *file,
1182 GDriveStartFlags flags,
1183 GMountOperation *start_operation,
1184 GCancellable *cancellable,
1185 GAsyncReadyCallback callback,
1186 gpointer user_data);
1187GLIB_AVAILABLE_IN_ALL
1188gboolean g_file_start_mountable_finish (GFile *file,
1189 GAsyncResult *result,
1190 GError **error);
1191GLIB_AVAILABLE_IN_ALL
1192void g_file_stop_mountable (GFile *file,
1193 GMountUnmountFlags flags,
1194 GMountOperation *mount_operation,
1195 GCancellable *cancellable,
1196 GAsyncReadyCallback callback,
1197 gpointer user_data);
1198GLIB_AVAILABLE_IN_ALL
1199gboolean g_file_stop_mountable_finish (GFile *file,
1200 GAsyncResult *result,
1201 GError **error);
1202
1203GLIB_AVAILABLE_IN_ALL
1204void g_file_poll_mountable (GFile *file,
1205 GCancellable *cancellable,
1206 GAsyncReadyCallback callback,
1207 gpointer user_data);
1208GLIB_AVAILABLE_IN_ALL
1209gboolean g_file_poll_mountable_finish (GFile *file,
1210 GAsyncResult *result,
1211 GError **error);
1212
1213/* Utilities */
1214
1215GLIB_AVAILABLE_IN_ALL
1216GAppInfo *g_file_query_default_handler (GFile *file,
1217 GCancellable *cancellable,
1218 GError **error);
1219GLIB_AVAILABLE_IN_2_60
1220void g_file_query_default_handler_async (GFile *file,
1221 int io_priority,
1222 GCancellable *cancellable,
1223 GAsyncReadyCallback callback,
1224 gpointer user_data);
1225GLIB_AVAILABLE_IN_2_60
1226GAppInfo *g_file_query_default_handler_finish (GFile *file,
1227 GAsyncResult *result,
1228 GError **error);
1229
1230GLIB_AVAILABLE_IN_ALL
1231gboolean g_file_load_contents (GFile *file,
1232 GCancellable *cancellable,
1233 char **contents,
1234 gsize *length,
1235 char **etag_out,
1236 GError **error);
1237GLIB_AVAILABLE_IN_ALL
1238void g_file_load_contents_async (GFile *file,
1239 GCancellable *cancellable,
1240 GAsyncReadyCallback callback,
1241 gpointer user_data);
1242GLIB_AVAILABLE_IN_ALL
1243gboolean g_file_load_contents_finish (GFile *file,
1244 GAsyncResult *res,
1245 char **contents,
1246 gsize *length,
1247 char **etag_out,
1248 GError **error);
1249GLIB_AVAILABLE_IN_ALL
1250void g_file_load_partial_contents_async (GFile *file,
1251 GCancellable *cancellable,
1252 GFileReadMoreCallback read_more_callback,
1253 GAsyncReadyCallback callback,
1254 gpointer user_data);
1255GLIB_AVAILABLE_IN_ALL
1256gboolean g_file_load_partial_contents_finish (GFile *file,
1257 GAsyncResult *res,
1258 char **contents,
1259 gsize *length,
1260 char **etag_out,
1261 GError **error);
1262GLIB_AVAILABLE_IN_ALL
1263gboolean g_file_replace_contents (GFile *file,
1264 const char *contents,
1265 gsize length,
1266 const char *etag,
1267 gboolean make_backup,
1268 GFileCreateFlags flags,
1269 char **new_etag,
1270 GCancellable *cancellable,
1271 GError **error);
1272GLIB_AVAILABLE_IN_ALL
1273void g_file_replace_contents_async (GFile *file,
1274 const char *contents,
1275 gsize length,
1276 const char *etag,
1277 gboolean make_backup,
1278 GFileCreateFlags flags,
1279 GCancellable *cancellable,
1280 GAsyncReadyCallback callback,
1281 gpointer user_data);
1282GLIB_AVAILABLE_IN_2_40
1283void g_file_replace_contents_bytes_async (GFile *file,
1284 GBytes *contents,
1285 const char *etag,
1286 gboolean make_backup,
1287 GFileCreateFlags flags,
1288 GCancellable *cancellable,
1289 GAsyncReadyCallback callback,
1290 gpointer user_data);
1291GLIB_AVAILABLE_IN_ALL
1292gboolean g_file_replace_contents_finish (GFile *file,
1293 GAsyncResult *res,
1294 char **new_etag,
1295 GError **error);
1296
1297GLIB_AVAILABLE_IN_ALL
1298gboolean g_file_supports_thread_contexts (GFile *file);
1299
1300GLIB_AVAILABLE_IN_2_56
1301GBytes *g_file_load_bytes (GFile *file,
1302 GCancellable *cancellable,
1303 gchar **etag_out,
1304 GError **error);
1305GLIB_AVAILABLE_IN_2_56
1306void g_file_load_bytes_async (GFile *file,
1307 GCancellable *cancellable,
1308 GAsyncReadyCallback callback,
1309 gpointer user_data);
1310GLIB_AVAILABLE_IN_2_56
1311GBytes *g_file_load_bytes_finish (GFile *file,
1312 GAsyncResult *result,
1313 gchar **etag_out,
1314 GError **error);
1315
1316G_END_DECLS
1317
1318#endif /* __G_FILE_H__ */
1319

source code of include/glib-2.0/gio/gfile.h