1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
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.
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.
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/>.
18 * Author: Alexander Larsson <alexl@redhat.com>
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
28 #include <gio/giotypes.h>
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))
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.
45 typedef struct _GFile GFile; /* Dummy typedef */
47 typedef struct _GFileIface 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.
125 * @_move_finish: Finishes an asynchronous move operation.
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
160 * An interface for writing VFS file handles.
164 GTypeInterface g_iface;
168 GFile * (* dup) (GFile *file);
169 guint (* hash) (GFile *file);
170 gboolean (* equal) (GFile *file1,
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,
183 char * (* get_relative_path) (GFile *parent,
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,
191 GFileEnumerator * (* enumerate_children) (GFile *file,
192 const char *attributes,
193 GFileQueryInfoFlags flags,
194 GCancellable *cancellable,
196 void (* enumerate_children_async) (GFile *file,
197 const char *attributes,
198 GFileQueryInfoFlags flags,
200 GCancellable *cancellable,
201 GAsyncReadyCallback callback,
203 GFileEnumerator * (* enumerate_children_finish) (GFile *file,
207 GFileInfo * (* query_info) (GFile *file,
208 const char *attributes,
209 GFileQueryInfoFlags flags,
210 GCancellable *cancellable,
212 void (* query_info_async) (GFile *file,
213 const char *attributes,
214 GFileQueryInfoFlags flags,
216 GCancellable *cancellable,
217 GAsyncReadyCallback callback,
219 GFileInfo * (* query_info_finish) (GFile *file,
223 GFileInfo * (* query_filesystem_info) (GFile *file,
224 const char *attributes,
225 GCancellable *cancellable,
227 void (* query_filesystem_info_async) (GFile *file,
228 const char *attributes,
230 GCancellable *cancellable,
231 GAsyncReadyCallback callback,
233 GFileInfo * (* query_filesystem_info_finish)(GFile *file,
237 GMount * (* find_enclosing_mount) (GFile *file,
238 GCancellable *cancellable,
240 void (* find_enclosing_mount_async) (GFile *file,
242 GCancellable *cancellable,
243 GAsyncReadyCallback callback,
245 GMount * (* find_enclosing_mount_finish) (GFile *file,
249 GFile * (* set_display_name) (GFile *file,
250 const char *display_name,
251 GCancellable *cancellable,
253 void (* set_display_name_async) (GFile *file,
254 const char *display_name,
256 GCancellable *cancellable,
257 GAsyncReadyCallback callback,
259 GFile * (* set_display_name_finish) (GFile *file,
263 GFileAttributeInfoList * (* query_settable_attributes) (GFile *file,
264 GCancellable *cancellable,
266 void (* _query_settable_attributes_async) (void);
267 void (* _query_settable_attributes_finish) (void);
269 GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file,
270 GCancellable *cancellable,
272 void (* _query_writable_namespaces_async) (void);
273 void (* _query_writable_namespaces_finish) (void);
275 gboolean (* set_attribute) (GFile *file,
276 const char *attribute,
277 GFileAttributeType type,
279 GFileQueryInfoFlags flags,
280 GCancellable *cancellable,
282 gboolean (* set_attributes_from_info) (GFile *file,
284 GFileQueryInfoFlags flags,
285 GCancellable *cancellable,
287 void (* set_attributes_async) (GFile *file,
289 GFileQueryInfoFlags flags,
291 GCancellable *cancellable,
292 GAsyncReadyCallback callback,
294 gboolean (* set_attributes_finish) (GFile *file,
295 GAsyncResult *result,
299 GFileInputStream * (* read_fn) (GFile *file,
300 GCancellable *cancellable,
302 void (* read_async) (GFile *file,
304 GCancellable *cancellable,
305 GAsyncReadyCallback callback,
307 GFileInputStream * (* read_finish) (GFile *file,
311 GFileOutputStream * (* append_to) (GFile *file,
312 GFileCreateFlags flags,
313 GCancellable *cancellable,
315 void (* append_to_async) (GFile *file,
316 GFileCreateFlags flags,
318 GCancellable *cancellable,
319 GAsyncReadyCallback callback,
321 GFileOutputStream * (* append_to_finish) (GFile *file,
325 GFileOutputStream * (* create) (GFile *file,
326 GFileCreateFlags flags,
327 GCancellable *cancellable,
329 void (* create_async) (GFile *file,
330 GFileCreateFlags flags,
332 GCancellable *cancellable,
333 GAsyncReadyCallback callback,
335 GFileOutputStream * (* create_finish) (GFile *file,
339 GFileOutputStream * (* replace) (GFile *file,
341 gboolean make_backup,
342 GFileCreateFlags flags,
343 GCancellable *cancellable,
345 void (* replace_async) (GFile *file,
347 gboolean make_backup,
348 GFileCreateFlags flags,
350 GCancellable *cancellable,
351 GAsyncReadyCallback callback,
353 GFileOutputStream * (* replace_finish) (GFile *file,
357 gboolean (* delete_file) (GFile *file,
358 GCancellable *cancellable,
360 void (* delete_file_async) (GFile *file,
362 GCancellable *cancellable,
363 GAsyncReadyCallback callback,
365 gboolean (* delete_file_finish) (GFile *file,
366 GAsyncResult *result,
369 gboolean (* trash) (GFile *file,
370 GCancellable *cancellable,
372 void (* trash_async) (GFile *file,
374 GCancellable *cancellable,
375 GAsyncReadyCallback callback,
377 gboolean (* trash_finish) (GFile *file,
378 GAsyncResult *result,
381 gboolean (* make_directory) (GFile *file,
382 GCancellable *cancellable,
384 void (* make_directory_async) (GFile *file,
386 GCancellable *cancellable,
387 GAsyncReadyCallback callback,
389 gboolean (* make_directory_finish) (GFile *file,
390 GAsyncResult *result,
393 gboolean (* make_symbolic_link) (GFile *file,
394 const char *symlink_value,
395 GCancellable *cancellable,
397 void (* _make_symbolic_link_async) (void);
398 void (* _make_symbolic_link_finish) (void);
400 gboolean (* copy) (GFile *source,
402 GFileCopyFlags flags,
403 GCancellable *cancellable,
404 GFileProgressCallback progress_callback,
405 gpointer progress_callback_data,
407 void (* copy_async) (GFile *source,
409 GFileCopyFlags flags,
411 GCancellable *cancellable,
412 GFileProgressCallback progress_callback,
413 gpointer progress_callback_data,
414 GAsyncReadyCallback callback,
416 gboolean (* copy_finish) (GFile *file,
420 gboolean (* move) (GFile *source,
422 GFileCopyFlags flags,
423 GCancellable *cancellable,
424 GFileProgressCallback progress_callback,
425 gpointer progress_callback_data,
427 void (* _move_async) (void);
428 void (* _move_finish) (void);
430 void (* mount_mountable) (GFile *file,
431 GMountMountFlags flags,
432 GMountOperation *mount_operation,
433 GCancellable *cancellable,
434 GAsyncReadyCallback callback,
436 GFile * (* mount_mountable_finish) (GFile *file,
437 GAsyncResult *result,
440 void (* unmount_mountable) (GFile *file,
441 GMountUnmountFlags flags,
442 GCancellable *cancellable,
443 GAsyncReadyCallback callback,
445 gboolean (* unmount_mountable_finish) (GFile *file,
446 GAsyncResult *result,
449 void (* eject_mountable) (GFile *file,
450 GMountUnmountFlags flags,
451 GCancellable *cancellable,
452 GAsyncReadyCallback callback,
454 gboolean (* eject_mountable_finish) (GFile *file,
455 GAsyncResult *result,
458 void (* mount_enclosing_volume) (GFile *location,
459 GMountMountFlags flags,
460 GMountOperation *mount_operation,
461 GCancellable *cancellable,
462 GAsyncReadyCallback callback,
464 gboolean (* mount_enclosing_volume_finish) (GFile *location,
465 GAsyncResult *result,
468 GFileMonitor * (* monitor_dir) (GFile *file,
469 GFileMonitorFlags flags,
470 GCancellable *cancellable,
472 GFileMonitor * (* monitor_file) (GFile *file,
473 GFileMonitorFlags flags,
474 GCancellable *cancellable,
477 GFileIOStream * (* open_readwrite) (GFile *file,
478 GCancellable *cancellable,
480 void (* open_readwrite_async) (GFile *file,
482 GCancellable *cancellable,
483 GAsyncReadyCallback callback,
485 GFileIOStream * (* open_readwrite_finish) (GFile *file,
488 GFileIOStream * (* create_readwrite) (GFile *file,
489 GFileCreateFlags flags,
490 GCancellable *cancellable,
492 void (* create_readwrite_async) (GFile *file,
493 GFileCreateFlags flags,
495 GCancellable *cancellable,
496 GAsyncReadyCallback callback,
498 GFileIOStream * (* create_readwrite_finish) (GFile *file,
501 GFileIOStream * (* replace_readwrite) (GFile *file,
503 gboolean make_backup,
504 GFileCreateFlags flags,
505 GCancellable *cancellable,
507 void (* replace_readwrite_async) (GFile *file,
509 gboolean make_backup,
510 GFileCreateFlags flags,
512 GCancellable *cancellable,
513 GAsyncReadyCallback callback,
515 GFileIOStream * (* replace_readwrite_finish) (GFile *file,
519 void (* start_mountable) (GFile *file,
520 GDriveStartFlags flags,
521 GMountOperation *start_operation,
522 GCancellable *cancellable,
523 GAsyncReadyCallback callback,
525 gboolean (* start_mountable_finish) (GFile *file,
526 GAsyncResult *result,
529 void (* stop_mountable) (GFile *file,
530 GMountUnmountFlags flags,
531 GMountOperation *mount_operation,
532 GCancellable *cancellable,
533 GAsyncReadyCallback callback,
535 gboolean (* stop_mountable_finish) (GFile *file,
536 GAsyncResult *result,
539 gboolean supports_thread_contexts;
541 void (* unmount_mountable_with_operation) (GFile *file,
542 GMountUnmountFlags flags,
543 GMountOperation *mount_operation,
544 GCancellable *cancellable,
545 GAsyncReadyCallback callback,
547 gboolean (* unmount_mountable_with_operation_finish) (GFile *file,
548 GAsyncResult *result,
551 void (* eject_mountable_with_operation) (GFile *file,
552 GMountUnmountFlags flags,
553 GMountOperation *mount_operation,
554 GCancellable *cancellable,
555 GAsyncReadyCallback callback,
557 gboolean (* eject_mountable_with_operation_finish) (GFile *file,
558 GAsyncResult *result,
561 void (* poll_mountable) (GFile *file,
562 GCancellable *cancellable,
563 GAsyncReadyCallback callback,
565 gboolean (* poll_mountable_finish) (GFile *file,
566 GAsyncResult *result,
569 gboolean (* measure_disk_usage) (GFile *file,
570 GFileMeasureFlags flags,
571 GCancellable *cancellable,
572 GFileMeasureProgressCallback progress_callback,
573 gpointer progress_data,
578 void (* measure_disk_usage_async) (GFile *file,
579 GFileMeasureFlags flags,
581 GCancellable *cancellable,
582 GFileMeasureProgressCallback progress_callback,
583 gpointer progress_data,
584 GAsyncReadyCallback callback,
586 gboolean (* measure_disk_usage_finish) (GFile *file,
587 GAsyncResult *result,
594 GLIB_AVAILABLE_IN_ALL
595 GType g_file_get_type (void) G_GNUC_CONST;
597 GLIB_AVAILABLE_IN_ALL
598 GFile * g_file_new_for_path (const char *path);
599 GLIB_AVAILABLE_IN_ALL
600 GFile * g_file_new_for_uri (const char *uri);
601 GLIB_AVAILABLE_IN_ALL
602 GFile * g_file_new_for_commandline_arg (const char *arg);
603 GLIB_AVAILABLE_IN_2_36
604 GFile * g_file_new_for_commandline_arg_and_cwd (const gchar *arg,
606 GLIB_AVAILABLE_IN_2_32
607 GFile * g_file_new_tmp (const char *tmpl,
608 GFileIOStream **iostream,
610 GLIB_AVAILABLE_IN_ALL
611 GFile * g_file_parse_name (const char *parse_name);
612 GLIB_AVAILABLE_IN_2_56
613 GFile * g_file_new_build_filename (const gchar *first_element,
614 ...) G_GNUC_NULL_TERMINATED;
615 GLIB_AVAILABLE_IN_ALL
616 GFile * g_file_dup (GFile *file);
617 GLIB_AVAILABLE_IN_ALL
618 guint g_file_hash (gconstpointer file);
619 GLIB_AVAILABLE_IN_ALL
620 gboolean g_file_equal (GFile *file1,
622 GLIB_AVAILABLE_IN_ALL
623 char * g_file_get_basename (GFile *file);
624 GLIB_AVAILABLE_IN_ALL
625 char * g_file_get_path (GFile *file);
626 GLIB_AVAILABLE_IN_2_56
627 const char * g_file_peek_path (GFile *file);
628 GLIB_AVAILABLE_IN_ALL
629 char * g_file_get_uri (GFile *file);
630 GLIB_AVAILABLE_IN_ALL
631 char * g_file_get_parse_name (GFile *file);
632 GLIB_AVAILABLE_IN_ALL
633 GFile * g_file_get_parent (GFile *file);
634 GLIB_AVAILABLE_IN_ALL
635 gboolean g_file_has_parent (GFile *file,
637 GLIB_AVAILABLE_IN_ALL
638 GFile * g_file_get_child (GFile *file,
640 GLIB_AVAILABLE_IN_ALL
641 GFile * g_file_get_child_for_display_name (GFile *file,
642 const char *display_name,
644 GLIB_AVAILABLE_IN_ALL
645 gboolean g_file_has_prefix (GFile *file,
647 GLIB_AVAILABLE_IN_ALL
648 char * g_file_get_relative_path (GFile *parent,
650 GLIB_AVAILABLE_IN_ALL
651 GFile * g_file_resolve_relative_path (GFile *file,
652 const char *relative_path);
653 GLIB_AVAILABLE_IN_ALL
654 gboolean g_file_is_native (GFile *file);
655 GLIB_AVAILABLE_IN_ALL
656 gboolean g_file_has_uri_scheme (GFile *file,
657 const char *uri_scheme);
658 GLIB_AVAILABLE_IN_ALL
659 char * g_file_get_uri_scheme (GFile *file);
660 GLIB_AVAILABLE_IN_ALL
661 GFileInputStream * g_file_read (GFile *file,
662 GCancellable *cancellable,
664 GLIB_AVAILABLE_IN_ALL
665 void g_file_read_async (GFile *file,
667 GCancellable *cancellable,
668 GAsyncReadyCallback callback,
670 GLIB_AVAILABLE_IN_ALL
671 GFileInputStream * g_file_read_finish (GFile *file,
674 GLIB_AVAILABLE_IN_ALL
675 GFileOutputStream * g_file_append_to (GFile *file,
676 GFileCreateFlags flags,
677 GCancellable *cancellable,
679 GLIB_AVAILABLE_IN_ALL
680 GFileOutputStream * g_file_create (GFile *file,
681 GFileCreateFlags flags,
682 GCancellable *cancellable,
684 GLIB_AVAILABLE_IN_ALL
685 GFileOutputStream * g_file_replace (GFile *file,
687 gboolean make_backup,
688 GFileCreateFlags flags,
689 GCancellable *cancellable,
691 GLIB_AVAILABLE_IN_ALL
692 void g_file_append_to_async (GFile *file,
693 GFileCreateFlags flags,
695 GCancellable *cancellable,
696 GAsyncReadyCallback callback,
698 GLIB_AVAILABLE_IN_ALL
699 GFileOutputStream * g_file_append_to_finish (GFile *file,
702 GLIB_AVAILABLE_IN_ALL
703 void g_file_create_async (GFile *file,
704 GFileCreateFlags flags,
706 GCancellable *cancellable,
707 GAsyncReadyCallback callback,
709 GLIB_AVAILABLE_IN_ALL
710 GFileOutputStream * g_file_create_finish (GFile *file,
713 GLIB_AVAILABLE_IN_ALL
714 void g_file_replace_async (GFile *file,
716 gboolean make_backup,
717 GFileCreateFlags flags,
719 GCancellable *cancellable,
720 GAsyncReadyCallback callback,
722 GLIB_AVAILABLE_IN_ALL
723 GFileOutputStream * g_file_replace_finish (GFile *file,
726 GLIB_AVAILABLE_IN_ALL
727 GFileIOStream * g_file_open_readwrite (GFile *file,
728 GCancellable *cancellable,
730 GLIB_AVAILABLE_IN_ALL
731 void g_file_open_readwrite_async (GFile *file,
733 GCancellable *cancellable,
734 GAsyncReadyCallback callback,
736 GLIB_AVAILABLE_IN_ALL
737 GFileIOStream * g_file_open_readwrite_finish (GFile *file,
740 GLIB_AVAILABLE_IN_ALL
741 GFileIOStream * g_file_create_readwrite (GFile *file,
742 GFileCreateFlags flags,
743 GCancellable *cancellable,
745 GLIB_AVAILABLE_IN_ALL
746 void g_file_create_readwrite_async (GFile *file,
747 GFileCreateFlags flags,
749 GCancellable *cancellable,
750 GAsyncReadyCallback callback,
752 GLIB_AVAILABLE_IN_ALL
753 GFileIOStream * g_file_create_readwrite_finish (GFile *file,
756 GLIB_AVAILABLE_IN_ALL
757 GFileIOStream * g_file_replace_readwrite (GFile *file,
759 gboolean make_backup,
760 GFileCreateFlags flags,
761 GCancellable *cancellable,
763 GLIB_AVAILABLE_IN_ALL
764 void g_file_replace_readwrite_async (GFile *file,
766 gboolean make_backup,
767 GFileCreateFlags flags,
769 GCancellable *cancellable,
770 GAsyncReadyCallback callback,
772 GLIB_AVAILABLE_IN_ALL
773 GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
776 GLIB_AVAILABLE_IN_ALL
777 gboolean g_file_query_exists (GFile *file,
778 GCancellable *cancellable);
779 GLIB_AVAILABLE_IN_ALL
780 GFileType g_file_query_file_type (GFile *file,
781 GFileQueryInfoFlags flags,
782 GCancellable *cancellable);
783 GLIB_AVAILABLE_IN_ALL
784 GFileInfo * g_file_query_info (GFile *file,
785 const char *attributes,
786 GFileQueryInfoFlags flags,
787 GCancellable *cancellable,
789 GLIB_AVAILABLE_IN_ALL
790 void g_file_query_info_async (GFile *file,
791 const char *attributes,
792 GFileQueryInfoFlags flags,
794 GCancellable *cancellable,
795 GAsyncReadyCallback callback,
797 GLIB_AVAILABLE_IN_ALL
798 GFileInfo * g_file_query_info_finish (GFile *file,
801 GLIB_AVAILABLE_IN_ALL
802 GFileInfo * g_file_query_filesystem_info (GFile *file,
803 const char *attributes,
804 GCancellable *cancellable,
806 GLIB_AVAILABLE_IN_ALL
807 void g_file_query_filesystem_info_async (GFile *file,
808 const char *attributes,
810 GCancellable *cancellable,
811 GAsyncReadyCallback callback,
813 GLIB_AVAILABLE_IN_ALL
814 GFileInfo * g_file_query_filesystem_info_finish (GFile *file,
817 GLIB_AVAILABLE_IN_ALL
818 GMount * g_file_find_enclosing_mount (GFile *file,
819 GCancellable *cancellable,
821 GLIB_AVAILABLE_IN_ALL
822 void g_file_find_enclosing_mount_async (GFile *file,
824 GCancellable *cancellable,
825 GAsyncReadyCallback callback,
827 GLIB_AVAILABLE_IN_ALL
828 GMount * g_file_find_enclosing_mount_finish (GFile *file,
831 GLIB_AVAILABLE_IN_ALL
832 GFileEnumerator * g_file_enumerate_children (GFile *file,
833 const char *attributes,
834 GFileQueryInfoFlags flags,
835 GCancellable *cancellable,
837 GLIB_AVAILABLE_IN_ALL
838 void g_file_enumerate_children_async (GFile *file,
839 const char *attributes,
840 GFileQueryInfoFlags flags,
842 GCancellable *cancellable,
843 GAsyncReadyCallback callback,
845 GLIB_AVAILABLE_IN_ALL
846 GFileEnumerator * g_file_enumerate_children_finish (GFile *file,
849 GLIB_AVAILABLE_IN_ALL
850 GFile * g_file_set_display_name (GFile *file,
851 const char *display_name,
852 GCancellable *cancellable,
854 GLIB_AVAILABLE_IN_ALL
855 void g_file_set_display_name_async (GFile *file,
856 const char *display_name,
858 GCancellable *cancellable,
859 GAsyncReadyCallback callback,
861 GLIB_AVAILABLE_IN_ALL
862 GFile * g_file_set_display_name_finish (GFile *file,
865 GLIB_AVAILABLE_IN_ALL
866 gboolean g_file_delete (GFile *file,
867 GCancellable *cancellable,
870 GLIB_AVAILABLE_IN_2_34
871 void g_file_delete_async (GFile *file,
873 GCancellable *cancellable,
874 GAsyncReadyCallback callback,
877 GLIB_AVAILABLE_IN_2_34
878 gboolean g_file_delete_finish (GFile *file,
879 GAsyncResult *result,
882 GLIB_AVAILABLE_IN_ALL
883 gboolean g_file_trash (GFile *file,
884 GCancellable *cancellable,
887 GLIB_AVAILABLE_IN_2_38
888 void g_file_trash_async (GFile *file,
890 GCancellable *cancellable,
891 GAsyncReadyCallback callback,
894 GLIB_AVAILABLE_IN_2_38
895 gboolean g_file_trash_finish (GFile *file,
896 GAsyncResult *result,
899 GLIB_AVAILABLE_IN_ALL
900 gboolean g_file_copy (GFile *source,
902 GFileCopyFlags flags,
903 GCancellable *cancellable,
904 GFileProgressCallback progress_callback,
905 gpointer progress_callback_data,
907 GLIB_AVAILABLE_IN_ALL
908 void g_file_copy_async (GFile *source,
910 GFileCopyFlags flags,
912 GCancellable *cancellable,
913 GFileProgressCallback progress_callback,
914 gpointer progress_callback_data,
915 GAsyncReadyCallback callback,
917 GLIB_AVAILABLE_IN_ALL
918 gboolean g_file_copy_finish (GFile *file,
921 GLIB_AVAILABLE_IN_ALL
922 gboolean g_file_move (GFile *source,
924 GFileCopyFlags flags,
925 GCancellable *cancellable,
926 GFileProgressCallback progress_callback,
927 gpointer progress_callback_data,
929 GLIB_AVAILABLE_IN_ALL
930 gboolean g_file_make_directory (GFile *file,
931 GCancellable *cancellable,
933 GLIB_AVAILABLE_IN_2_38
934 void g_file_make_directory_async (GFile *file,
936 GCancellable *cancellable,
937 GAsyncReadyCallback callback,
939 GLIB_AVAILABLE_IN_2_38
940 gboolean g_file_make_directory_finish (GFile *file,
941 GAsyncResult *result,
944 GLIB_AVAILABLE_IN_ALL
945 gboolean g_file_make_directory_with_parents (GFile *file,
946 GCancellable *cancellable,
948 GLIB_AVAILABLE_IN_ALL
949 gboolean g_file_make_symbolic_link (GFile *file,
950 const char *symlink_value,
951 GCancellable *cancellable,
953 GLIB_AVAILABLE_IN_ALL
954 GFileAttributeInfoList *g_file_query_settable_attributes (GFile *file,
955 GCancellable *cancellable,
957 GLIB_AVAILABLE_IN_ALL
958 GFileAttributeInfoList *g_file_query_writable_namespaces (GFile *file,
959 GCancellable *cancellable,
961 GLIB_AVAILABLE_IN_ALL
962 gboolean g_file_set_attribute (GFile *file,
963 const char *attribute,
964 GFileAttributeType type,
966 GFileQueryInfoFlags flags,
967 GCancellable *cancellable,
969 GLIB_AVAILABLE_IN_ALL
970 gboolean g_file_set_attributes_from_info (GFile *file,
972 GFileQueryInfoFlags flags,
973 GCancellable *cancellable,
975 GLIB_AVAILABLE_IN_ALL
976 void g_file_set_attributes_async (GFile *file,
978 GFileQueryInfoFlags flags,
980 GCancellable *cancellable,
981 GAsyncReadyCallback callback,
983 GLIB_AVAILABLE_IN_ALL
984 gboolean g_file_set_attributes_finish (GFile *file,
985 GAsyncResult *result,
988 GLIB_AVAILABLE_IN_ALL
989 gboolean g_file_set_attribute_string (GFile *file,
990 const char *attribute,
992 GFileQueryInfoFlags flags,
993 GCancellable *cancellable,
995 GLIB_AVAILABLE_IN_ALL
996 gboolean g_file_set_attribute_byte_string (GFile *file,
997 const char *attribute,
999 GFileQueryInfoFlags flags,
1000 GCancellable *cancellable,
1002 GLIB_AVAILABLE_IN_ALL
1003 gboolean g_file_set_attribute_uint32 (GFile *file,
1004 const char *attribute,
1006 GFileQueryInfoFlags flags,
1007 GCancellable *cancellable,
1009 GLIB_AVAILABLE_IN_ALL
1010 gboolean g_file_set_attribute_int32 (GFile *file,
1011 const char *attribute,
1013 GFileQueryInfoFlags flags,
1014 GCancellable *cancellable,
1016 GLIB_AVAILABLE_IN_ALL
1017 gboolean g_file_set_attribute_uint64 (GFile *file,
1018 const char *attribute,
1020 GFileQueryInfoFlags flags,
1021 GCancellable *cancellable,
1023 GLIB_AVAILABLE_IN_ALL
1024 gboolean g_file_set_attribute_int64 (GFile *file,
1025 const char *attribute,
1027 GFileQueryInfoFlags flags,
1028 GCancellable *cancellable,
1030 GLIB_AVAILABLE_IN_ALL
1031 void g_file_mount_enclosing_volume (GFile *location,
1032 GMountMountFlags flags,
1033 GMountOperation *mount_operation,
1034 GCancellable *cancellable,
1035 GAsyncReadyCallback callback,
1036 gpointer user_data);
1037 GLIB_AVAILABLE_IN_ALL
1038 gboolean g_file_mount_enclosing_volume_finish (GFile *location,
1039 GAsyncResult *result,
1041 GLIB_AVAILABLE_IN_ALL
1042 void g_file_mount_mountable (GFile *file,
1043 GMountMountFlags flags,
1044 GMountOperation *mount_operation,
1045 GCancellable *cancellable,
1046 GAsyncReadyCallback callback,
1047 gpointer user_data);
1048 GLIB_AVAILABLE_IN_ALL
1049 GFile * g_file_mount_mountable_finish (GFile *file,
1050 GAsyncResult *result,
1052 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
1053 void g_file_unmount_mountable (GFile *file,
1054 GMountUnmountFlags flags,
1055 GCancellable *cancellable,
1056 GAsyncReadyCallback callback,
1057 gpointer user_data);
1059 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
1060 gboolean g_file_unmount_mountable_finish (GFile *file,
1061 GAsyncResult *result,
1063 GLIB_AVAILABLE_IN_ALL
1064 void g_file_unmount_mountable_with_operation (GFile *file,
1065 GMountUnmountFlags flags,
1066 GMountOperation *mount_operation,
1067 GCancellable *cancellable,
1068 GAsyncReadyCallback callback,
1069 gpointer user_data);
1070 GLIB_AVAILABLE_IN_ALL
1071 gboolean g_file_unmount_mountable_with_operation_finish (GFile *file,
1072 GAsyncResult *result,
1074 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1075 void g_file_eject_mountable (GFile *file,
1076 GMountUnmountFlags flags,
1077 GCancellable *cancellable,
1078 GAsyncReadyCallback callback,
1079 gpointer user_data);
1081 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1082 gboolean g_file_eject_mountable_finish (GFile *file,
1083 GAsyncResult *result,
1085 GLIB_AVAILABLE_IN_ALL
1086 void g_file_eject_mountable_with_operation (GFile *file,
1087 GMountUnmountFlags flags,
1088 GMountOperation *mount_operation,
1089 GCancellable *cancellable,
1090 GAsyncReadyCallback callback,
1091 gpointer user_data);
1092 GLIB_AVAILABLE_IN_ALL
1093 gboolean g_file_eject_mountable_with_operation_finish (GFile *file,
1094 GAsyncResult *result,
1097 GLIB_AVAILABLE_IN_ALL
1098 gboolean g_file_copy_attributes (GFile *source,
1100 GFileCopyFlags flags,
1101 GCancellable *cancellable,
1105 GLIB_AVAILABLE_IN_ALL
1106 GFileMonitor* g_file_monitor_directory (GFile *file,
1107 GFileMonitorFlags flags,
1108 GCancellable *cancellable,
1110 GLIB_AVAILABLE_IN_ALL
1111 GFileMonitor* g_file_monitor_file (GFile *file,
1112 GFileMonitorFlags flags,
1113 GCancellable *cancellable,
1115 GLIB_AVAILABLE_IN_ALL
1116 GFileMonitor* g_file_monitor (GFile *file,
1117 GFileMonitorFlags flags,
1118 GCancellable *cancellable,
1121 GLIB_AVAILABLE_IN_2_38
1122 gboolean g_file_measure_disk_usage (GFile *file,
1123 GFileMeasureFlags flags,
1124 GCancellable *cancellable,
1125 GFileMeasureProgressCallback progress_callback,
1126 gpointer progress_data,
1127 guint64 *disk_usage,
1132 GLIB_AVAILABLE_IN_2_38
1133 void g_file_measure_disk_usage_async (GFile *file,
1134 GFileMeasureFlags flags,
1136 GCancellable *cancellable,
1137 GFileMeasureProgressCallback progress_callback,
1138 gpointer progress_data,
1139 GAsyncReadyCallback callback,
1140 gpointer user_data);
1142 GLIB_AVAILABLE_IN_2_38
1143 gboolean g_file_measure_disk_usage_finish (GFile *file,
1144 GAsyncResult *result,
1145 guint64 *disk_usage,
1150 GLIB_AVAILABLE_IN_ALL
1151 void g_file_start_mountable (GFile *file,
1152 GDriveStartFlags flags,
1153 GMountOperation *start_operation,
1154 GCancellable *cancellable,
1155 GAsyncReadyCallback callback,
1156 gpointer user_data);
1157 GLIB_AVAILABLE_IN_ALL
1158 gboolean g_file_start_mountable_finish (GFile *file,
1159 GAsyncResult *result,
1161 GLIB_AVAILABLE_IN_ALL
1162 void g_file_stop_mountable (GFile *file,
1163 GMountUnmountFlags flags,
1164 GMountOperation *mount_operation,
1165 GCancellable *cancellable,
1166 GAsyncReadyCallback callback,
1167 gpointer user_data);
1168 GLIB_AVAILABLE_IN_ALL
1169 gboolean g_file_stop_mountable_finish (GFile *file,
1170 GAsyncResult *result,
1173 GLIB_AVAILABLE_IN_ALL
1174 void g_file_poll_mountable (GFile *file,
1175 GCancellable *cancellable,
1176 GAsyncReadyCallback callback,
1177 gpointer user_data);
1178 GLIB_AVAILABLE_IN_ALL
1179 gboolean g_file_poll_mountable_finish (GFile *file,
1180 GAsyncResult *result,
1185 GLIB_AVAILABLE_IN_ALL
1186 GAppInfo *g_file_query_default_handler (GFile *file,
1187 GCancellable *cancellable,
1189 GLIB_AVAILABLE_IN_2_60
1190 void g_file_query_default_handler_async (GFile *file,
1192 GCancellable *cancellable,
1193 GAsyncReadyCallback callback,
1194 gpointer user_data);
1195 GLIB_AVAILABLE_IN_2_60
1196 GAppInfo *g_file_query_default_handler_finish (GFile *file,
1197 GAsyncResult *result,
1200 GLIB_AVAILABLE_IN_ALL
1201 gboolean g_file_load_contents (GFile *file,
1202 GCancellable *cancellable,
1207 GLIB_AVAILABLE_IN_ALL
1208 void g_file_load_contents_async (GFile *file,
1209 GCancellable *cancellable,
1210 GAsyncReadyCallback callback,
1211 gpointer user_data);
1212 GLIB_AVAILABLE_IN_ALL
1213 gboolean g_file_load_contents_finish (GFile *file,
1219 GLIB_AVAILABLE_IN_ALL
1220 void g_file_load_partial_contents_async (GFile *file,
1221 GCancellable *cancellable,
1222 GFileReadMoreCallback read_more_callback,
1223 GAsyncReadyCallback callback,
1224 gpointer user_data);
1225 GLIB_AVAILABLE_IN_ALL
1226 gboolean g_file_load_partial_contents_finish (GFile *file,
1232 GLIB_AVAILABLE_IN_ALL
1233 gboolean g_file_replace_contents (GFile *file,
1234 const char *contents,
1237 gboolean make_backup,
1238 GFileCreateFlags flags,
1240 GCancellable *cancellable,
1242 GLIB_AVAILABLE_IN_ALL
1243 void g_file_replace_contents_async (GFile *file,
1244 const char *contents,
1247 gboolean make_backup,
1248 GFileCreateFlags flags,
1249 GCancellable *cancellable,
1250 GAsyncReadyCallback callback,
1251 gpointer user_data);
1252 GLIB_AVAILABLE_IN_2_40
1253 void g_file_replace_contents_bytes_async (GFile *file,
1256 gboolean make_backup,
1257 GFileCreateFlags flags,
1258 GCancellable *cancellable,
1259 GAsyncReadyCallback callback,
1260 gpointer user_data);
1261 GLIB_AVAILABLE_IN_ALL
1262 gboolean g_file_replace_contents_finish (GFile *file,
1267 GLIB_AVAILABLE_IN_ALL
1268 gboolean g_file_supports_thread_contexts (GFile *file);
1270 GLIB_AVAILABLE_IN_2_56
1271 GBytes *g_file_load_bytes (GFile *file,
1272 GCancellable *cancellable,
1275 GLIB_AVAILABLE_IN_2_56
1276 void g_file_load_bytes_async (GFile *file,
1277 GCancellable *cancellable,
1278 GAsyncReadyCallback callback,
1279 gpointer user_data);
1280 GLIB_AVAILABLE_IN_2_56
1281 GBytes *g_file_load_bytes_finish (GFile *file,
1282 GAsyncResult *result,
1288 #endif /* __G_FILE_H__ */