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 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 #GFileAttributes that can be set.
84 * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttributes that can be set.
85 * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
86 * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable.
87 * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable.
88 * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
89 * @set_attribute: Sets a #GFileAttribute.
90 * @set_attributes_from_info: Sets a #GFileAttribute 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: Makes a symbolic link.
115 * @_make_symbolic_link_async: Asynchronously makes a symbolic link
116 * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
117 * @copy: Copies a file.
118 * @copy_async: Asynchronously copies a file.
119 * @copy_finish: Finishes an asynchronous copy operation.
120 * @move: Moves a file.
121 * @_move_async: Asynchronously moves a file.
122 * @_move_finish: Finishes an asynchronous move operation.
123 * @mount_mountable: Mounts a mountable object.
124 * @mount_mountable_finish: Finishes a mounting operation.
125 * @unmount_mountable: Unmounts a mountable object.
126 * @unmount_mountable_finish: Finishes an unmount operation.
127 * @eject_mountable: Ejects a mountable.
128 * @eject_mountable_finish: Finishes an eject operation.
129 * @mount_enclosing_volume: Mounts a specified location.
130 * @mount_enclosing_volume_finish: Finishes mounting a specified location.
131 * @monitor_dir: Creates a #GFileMonitor for the location.
132 * @monitor_file: Creates a #GFileMonitor for the location.
133 * @open_readwrite: Open file read/write. Since 2.22.
134 * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
135 * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
136 * @create_readwrite: Creates file read/write. Since 2.22.
137 * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
138 * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
139 * @replace_readwrite: Replaces file read/write. Since 2.22.
140 * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
141 * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
142 * @start_mountable: Starts a mountable object. Since 2.22.
143 * @start_mountable_finish: Finishes an start operation. Since 2.22.
144 * @stop_mountable: Stops a mountable. Since 2.22.
145 * @stop_mountable_finish: Finishes an stop operation. Since 2.22.
146 * @supports_thread_contexts: a boolean that indicates whether the #GFile implementation supports thread-default contexts. Since 2.22.
147 * @unmount_mountable_with_operation: Unmounts a mountable object using a #GMountOperation. Since 2.22.
148 * @unmount_mountable_with_operation_finish: Finishes an unmount operation using a #GMountOperation. Since 2.22.
149 * @eject_mountable_with_operation: Ejects a mountable object using a #GMountOperation. Since 2.22.
150 * @eject_mountable_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
151 * @poll_mountable: Polls a mountable object for media changes. Since 2.22.
152 * @poll_mountable_finish: Finishes an poll operation for media changes. Since 2.22.
154 * An interface for writing VFS file handles.
158 GTypeInterface g_iface;
162 GFile * (* dup) (GFile *file);
163 guint (* hash) (GFile *file);
164 gboolean (* equal) (GFile *file1,
166 gboolean (* is_native) (GFile *file);
167 gboolean (* has_uri_scheme) (GFile *file,
168 const char *uri_scheme);
169 char * (* get_uri_scheme) (GFile *file);
170 char * (* get_basename) (GFile *file);
171 char * (* get_path) (GFile *file);
172 char * (* get_uri) (GFile *file);
173 char * (* get_parse_name) (GFile *file);
174 GFile * (* get_parent) (GFile *file);
175 gboolean (* prefix_matches) (GFile *prefix,
177 char * (* get_relative_path) (GFile *parent,
179 GFile * (* resolve_relative_path) (GFile *file,
180 const char *relative_path);
181 GFile * (* get_child_for_display_name) (GFile *file,
182 const char *display_name,
185 GFileEnumerator * (* enumerate_children) (GFile *file,
186 const char *attributes,
187 GFileQueryInfoFlags flags,
188 GCancellable *cancellable,
190 void (* enumerate_children_async) (GFile *file,
191 const char *attributes,
192 GFileQueryInfoFlags flags,
194 GCancellable *cancellable,
195 GAsyncReadyCallback callback,
197 GFileEnumerator * (* enumerate_children_finish) (GFile *file,
201 GFileInfo * (* query_info) (GFile *file,
202 const char *attributes,
203 GFileQueryInfoFlags flags,
204 GCancellable *cancellable,
206 void (* query_info_async) (GFile *file,
207 const char *attributes,
208 GFileQueryInfoFlags flags,
210 GCancellable *cancellable,
211 GAsyncReadyCallback callback,
213 GFileInfo * (* query_info_finish) (GFile *file,
217 GFileInfo * (* query_filesystem_info) (GFile *file,
218 const char *attributes,
219 GCancellable *cancellable,
221 void (* query_filesystem_info_async) (GFile *file,
222 const char *attributes,
224 GCancellable *cancellable,
225 GAsyncReadyCallback callback,
227 GFileInfo * (* query_filesystem_info_finish)(GFile *file,
231 GMount * (* find_enclosing_mount) (GFile *file,
232 GCancellable *cancellable,
234 void (* find_enclosing_mount_async) (GFile *file,
236 GCancellable *cancellable,
237 GAsyncReadyCallback callback,
239 GMount * (* find_enclosing_mount_finish) (GFile *file,
243 GFile * (* set_display_name) (GFile *file,
244 const char *display_name,
245 GCancellable *cancellable,
247 void (* set_display_name_async) (GFile *file,
248 const char *display_name,
250 GCancellable *cancellable,
251 GAsyncReadyCallback callback,
253 GFile * (* set_display_name_finish) (GFile *file,
257 GFileAttributeInfoList * (* query_settable_attributes) (GFile *file,
258 GCancellable *cancellable,
260 void (* _query_settable_attributes_async) (void);
261 void (* _query_settable_attributes_finish) (void);
263 GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file,
264 GCancellable *cancellable,
266 void (* _query_writable_namespaces_async) (void);
267 void (* _query_writable_namespaces_finish) (void);
269 gboolean (* set_attribute) (GFile *file,
270 const char *attribute,
271 GFileAttributeType type,
273 GFileQueryInfoFlags flags,
274 GCancellable *cancellable,
276 gboolean (* set_attributes_from_info) (GFile *file,
278 GFileQueryInfoFlags flags,
279 GCancellable *cancellable,
281 void (* set_attributes_async) (GFile *file,
283 GFileQueryInfoFlags flags,
285 GCancellable *cancellable,
286 GAsyncReadyCallback callback,
288 gboolean (* set_attributes_finish) (GFile *file,
289 GAsyncResult *result,
293 GFileInputStream * (* read_fn) (GFile *file,
294 GCancellable *cancellable,
296 void (* read_async) (GFile *file,
298 GCancellable *cancellable,
299 GAsyncReadyCallback callback,
301 GFileInputStream * (* read_finish) (GFile *file,
305 GFileOutputStream * (* append_to) (GFile *file,
306 GFileCreateFlags flags,
307 GCancellable *cancellable,
309 void (* append_to_async) (GFile *file,
310 GFileCreateFlags flags,
312 GCancellable *cancellable,
313 GAsyncReadyCallback callback,
315 GFileOutputStream * (* append_to_finish) (GFile *file,
319 GFileOutputStream * (* create) (GFile *file,
320 GFileCreateFlags flags,
321 GCancellable *cancellable,
323 void (* create_async) (GFile *file,
324 GFileCreateFlags flags,
326 GCancellable *cancellable,
327 GAsyncReadyCallback callback,
329 GFileOutputStream * (* create_finish) (GFile *file,
333 GFileOutputStream * (* replace) (GFile *file,
335 gboolean make_backup,
336 GFileCreateFlags flags,
337 GCancellable *cancellable,
339 void (* replace_async) (GFile *file,
341 gboolean make_backup,
342 GFileCreateFlags flags,
344 GCancellable *cancellable,
345 GAsyncReadyCallback callback,
347 GFileOutputStream * (* replace_finish) (GFile *file,
351 gboolean (* delete_file) (GFile *file,
352 GCancellable *cancellable,
354 void (* delete_file_async) (GFile *file,
356 GCancellable *cancellable,
357 GAsyncReadyCallback callback,
359 gboolean (* delete_file_finish) (GFile *file,
360 GAsyncResult *result,
363 gboolean (* trash) (GFile *file,
364 GCancellable *cancellable,
366 void (* trash_async) (GFile *file,
368 GCancellable *cancellable,
369 GAsyncReadyCallback callback,
371 gboolean (* trash_finish) (GFile *file,
372 GAsyncResult *result,
375 gboolean (* make_directory) (GFile *file,
376 GCancellable *cancellable,
378 void (* make_directory_async) (GFile *file,
380 GCancellable *cancellable,
381 GAsyncReadyCallback callback,
383 gboolean (* make_directory_finish) (GFile *file,
384 GAsyncResult *result,
387 gboolean (* make_symbolic_link) (GFile *file,
388 const char *symlink_value,
389 GCancellable *cancellable,
391 void (* _make_symbolic_link_async) (void);
392 void (* _make_symbolic_link_finish) (void);
394 gboolean (* copy) (GFile *source,
396 GFileCopyFlags flags,
397 GCancellable *cancellable,
398 GFileProgressCallback progress_callback,
399 gpointer progress_callback_data,
401 void (* copy_async) (GFile *source,
403 GFileCopyFlags flags,
405 GCancellable *cancellable,
406 GFileProgressCallback progress_callback,
407 gpointer progress_callback_data,
408 GAsyncReadyCallback callback,
410 gboolean (* copy_finish) (GFile *file,
414 gboolean (* move) (GFile *source,
416 GFileCopyFlags flags,
417 GCancellable *cancellable,
418 GFileProgressCallback progress_callback,
419 gpointer progress_callback_data,
421 void (* _move_async) (void);
422 void (* _move_finish) (void);
424 void (* mount_mountable) (GFile *file,
425 GMountMountFlags flags,
426 GMountOperation *mount_operation,
427 GCancellable *cancellable,
428 GAsyncReadyCallback callback,
430 GFile * (* mount_mountable_finish) (GFile *file,
431 GAsyncResult *result,
434 void (* unmount_mountable) (GFile *file,
435 GMountUnmountFlags flags,
436 GCancellable *cancellable,
437 GAsyncReadyCallback callback,
439 gboolean (* unmount_mountable_finish) (GFile *file,
440 GAsyncResult *result,
443 void (* eject_mountable) (GFile *file,
444 GMountUnmountFlags flags,
445 GCancellable *cancellable,
446 GAsyncReadyCallback callback,
448 gboolean (* eject_mountable_finish) (GFile *file,
449 GAsyncResult *result,
452 void (* mount_enclosing_volume) (GFile *location,
453 GMountMountFlags flags,
454 GMountOperation *mount_operation,
455 GCancellable *cancellable,
456 GAsyncReadyCallback callback,
458 gboolean (* mount_enclosing_volume_finish) (GFile *location,
459 GAsyncResult *result,
462 GFileMonitor * (* monitor_dir) (GFile *file,
463 GFileMonitorFlags flags,
464 GCancellable *cancellable,
466 GFileMonitor * (* monitor_file) (GFile *file,
467 GFileMonitorFlags flags,
468 GCancellable *cancellable,
471 GFileIOStream * (* open_readwrite) (GFile *file,
472 GCancellable *cancellable,
474 void (* open_readwrite_async) (GFile *file,
476 GCancellable *cancellable,
477 GAsyncReadyCallback callback,
479 GFileIOStream * (* open_readwrite_finish) (GFile *file,
482 GFileIOStream * (* create_readwrite) (GFile *file,
483 GFileCreateFlags flags,
484 GCancellable *cancellable,
486 void (* create_readwrite_async) (GFile *file,
487 GFileCreateFlags flags,
489 GCancellable *cancellable,
490 GAsyncReadyCallback callback,
492 GFileIOStream * (* create_readwrite_finish) (GFile *file,
495 GFileIOStream * (* replace_readwrite) (GFile *file,
497 gboolean make_backup,
498 GFileCreateFlags flags,
499 GCancellable *cancellable,
501 void (* replace_readwrite_async) (GFile *file,
503 gboolean make_backup,
504 GFileCreateFlags flags,
506 GCancellable *cancellable,
507 GAsyncReadyCallback callback,
509 GFileIOStream * (* replace_readwrite_finish) (GFile *file,
513 void (* start_mountable) (GFile *file,
514 GDriveStartFlags flags,
515 GMountOperation *start_operation,
516 GCancellable *cancellable,
517 GAsyncReadyCallback callback,
519 gboolean (* start_mountable_finish) (GFile *file,
520 GAsyncResult *result,
523 void (* stop_mountable) (GFile *file,
524 GMountUnmountFlags flags,
525 GMountOperation *mount_operation,
526 GCancellable *cancellable,
527 GAsyncReadyCallback callback,
529 gboolean (* stop_mountable_finish) (GFile *file,
530 GAsyncResult *result,
533 gboolean supports_thread_contexts;
535 void (* unmount_mountable_with_operation) (GFile *file,
536 GMountUnmountFlags flags,
537 GMountOperation *mount_operation,
538 GCancellable *cancellable,
539 GAsyncReadyCallback callback,
541 gboolean (* unmount_mountable_with_operation_finish) (GFile *file,
542 GAsyncResult *result,
545 void (* eject_mountable_with_operation) (GFile *file,
546 GMountUnmountFlags flags,
547 GMountOperation *mount_operation,
548 GCancellable *cancellable,
549 GAsyncReadyCallback callback,
551 gboolean (* eject_mountable_with_operation_finish) (GFile *file,
552 GAsyncResult *result,
555 void (* poll_mountable) (GFile *file,
556 GCancellable *cancellable,
557 GAsyncReadyCallback callback,
559 gboolean (* poll_mountable_finish) (GFile *file,
560 GAsyncResult *result,
563 gboolean (* measure_disk_usage) (GFile *file,
564 GFileMeasureFlags flags,
565 GCancellable *cancellable,
566 GFileMeasureProgressCallback progress_callback,
567 gpointer progress_data,
572 void (* measure_disk_usage_async) (GFile *file,
573 GFileMeasureFlags flags,
575 GCancellable *cancellable,
576 GFileMeasureProgressCallback progress_callback,
577 gpointer progress_data,
578 GAsyncReadyCallback callback,
580 gboolean (* measure_disk_usage_finish) (GFile *file,
581 GAsyncResult *result,
588 GLIB_AVAILABLE_IN_ALL
589 GType g_file_get_type (void) G_GNUC_CONST;
591 GLIB_AVAILABLE_IN_ALL
592 GFile * g_file_new_for_path (const char *path);
593 GLIB_AVAILABLE_IN_ALL
594 GFile * g_file_new_for_uri (const char *uri);
595 GLIB_AVAILABLE_IN_ALL
596 GFile * g_file_new_for_commandline_arg (const char *arg);
597 GLIB_AVAILABLE_IN_2_36
598 GFile * g_file_new_for_commandline_arg_and_cwd (const gchar *arg,
600 GLIB_AVAILABLE_IN_2_32
601 GFile * g_file_new_tmp (const char *tmpl,
602 GFileIOStream **iostream,
604 GLIB_AVAILABLE_IN_ALL
605 GFile * g_file_parse_name (const char *parse_name);
606 GLIB_AVAILABLE_IN_ALL
607 GFile * g_file_dup (GFile *file);
608 GLIB_AVAILABLE_IN_ALL
609 guint g_file_hash (gconstpointer file);
610 GLIB_AVAILABLE_IN_ALL
611 gboolean g_file_equal (GFile *file1,
613 GLIB_AVAILABLE_IN_ALL
614 char * g_file_get_basename (GFile *file);
615 GLIB_AVAILABLE_IN_ALL
616 char * g_file_get_path (GFile *file);
617 GLIB_AVAILABLE_IN_ALL
618 char * g_file_get_uri (GFile *file);
619 GLIB_AVAILABLE_IN_ALL
620 char * g_file_get_parse_name (GFile *file);
621 GLIB_AVAILABLE_IN_ALL
622 GFile * g_file_get_parent (GFile *file);
623 GLIB_AVAILABLE_IN_ALL
624 gboolean g_file_has_parent (GFile *file,
626 GLIB_AVAILABLE_IN_ALL
627 GFile * g_file_get_child (GFile *file,
629 GLIB_AVAILABLE_IN_ALL
630 GFile * g_file_get_child_for_display_name (GFile *file,
631 const char *display_name,
633 GLIB_AVAILABLE_IN_ALL
634 gboolean g_file_has_prefix (GFile *file,
636 GLIB_AVAILABLE_IN_ALL
637 char * g_file_get_relative_path (GFile *parent,
639 GLIB_AVAILABLE_IN_ALL
640 GFile * g_file_resolve_relative_path (GFile *file,
641 const char *relative_path);
642 GLIB_AVAILABLE_IN_ALL
643 gboolean g_file_is_native (GFile *file);
644 GLIB_AVAILABLE_IN_ALL
645 gboolean g_file_has_uri_scheme (GFile *file,
646 const char *uri_scheme);
647 GLIB_AVAILABLE_IN_ALL
648 char * g_file_get_uri_scheme (GFile *file);
649 GLIB_AVAILABLE_IN_ALL
650 GFileInputStream * g_file_read (GFile *file,
651 GCancellable *cancellable,
653 GLIB_AVAILABLE_IN_ALL
654 void g_file_read_async (GFile *file,
656 GCancellable *cancellable,
657 GAsyncReadyCallback callback,
659 GLIB_AVAILABLE_IN_ALL
660 GFileInputStream * g_file_read_finish (GFile *file,
663 GLIB_AVAILABLE_IN_ALL
664 GFileOutputStream * g_file_append_to (GFile *file,
665 GFileCreateFlags flags,
666 GCancellable *cancellable,
668 GLIB_AVAILABLE_IN_ALL
669 GFileOutputStream * g_file_create (GFile *file,
670 GFileCreateFlags flags,
671 GCancellable *cancellable,
673 GLIB_AVAILABLE_IN_ALL
674 GFileOutputStream * g_file_replace (GFile *file,
676 gboolean make_backup,
677 GFileCreateFlags flags,
678 GCancellable *cancellable,
680 GLIB_AVAILABLE_IN_ALL
681 void g_file_append_to_async (GFile *file,
682 GFileCreateFlags flags,
684 GCancellable *cancellable,
685 GAsyncReadyCallback callback,
687 GLIB_AVAILABLE_IN_ALL
688 GFileOutputStream * g_file_append_to_finish (GFile *file,
691 GLIB_AVAILABLE_IN_ALL
692 void g_file_create_async (GFile *file,
693 GFileCreateFlags flags,
695 GCancellable *cancellable,
696 GAsyncReadyCallback callback,
698 GLIB_AVAILABLE_IN_ALL
699 GFileOutputStream * g_file_create_finish (GFile *file,
702 GLIB_AVAILABLE_IN_ALL
703 void g_file_replace_async (GFile *file,
705 gboolean make_backup,
706 GFileCreateFlags flags,
708 GCancellable *cancellable,
709 GAsyncReadyCallback callback,
711 GLIB_AVAILABLE_IN_ALL
712 GFileOutputStream * g_file_replace_finish (GFile *file,
715 GLIB_AVAILABLE_IN_ALL
716 GFileIOStream * g_file_open_readwrite (GFile *file,
717 GCancellable *cancellable,
719 GLIB_AVAILABLE_IN_ALL
720 void g_file_open_readwrite_async (GFile *file,
722 GCancellable *cancellable,
723 GAsyncReadyCallback callback,
725 GLIB_AVAILABLE_IN_ALL
726 GFileIOStream * g_file_open_readwrite_finish (GFile *file,
729 GLIB_AVAILABLE_IN_ALL
730 GFileIOStream * g_file_create_readwrite (GFile *file,
731 GFileCreateFlags flags,
732 GCancellable *cancellable,
734 GLIB_AVAILABLE_IN_ALL
735 void g_file_create_readwrite_async (GFile *file,
736 GFileCreateFlags flags,
738 GCancellable *cancellable,
739 GAsyncReadyCallback callback,
741 GLIB_AVAILABLE_IN_ALL
742 GFileIOStream * g_file_create_readwrite_finish (GFile *file,
745 GLIB_AVAILABLE_IN_ALL
746 GFileIOStream * g_file_replace_readwrite (GFile *file,
748 gboolean make_backup,
749 GFileCreateFlags flags,
750 GCancellable *cancellable,
752 GLIB_AVAILABLE_IN_ALL
753 void g_file_replace_readwrite_async (GFile *file,
755 gboolean make_backup,
756 GFileCreateFlags flags,
758 GCancellable *cancellable,
759 GAsyncReadyCallback callback,
761 GLIB_AVAILABLE_IN_ALL
762 GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
765 GLIB_AVAILABLE_IN_ALL
766 gboolean g_file_query_exists (GFile *file,
767 GCancellable *cancellable);
768 GLIB_AVAILABLE_IN_ALL
769 GFileType g_file_query_file_type (GFile *file,
770 GFileQueryInfoFlags flags,
771 GCancellable *cancellable);
772 GLIB_AVAILABLE_IN_ALL
773 GFileInfo * g_file_query_info (GFile *file,
774 const char *attributes,
775 GFileQueryInfoFlags flags,
776 GCancellable *cancellable,
778 GLIB_AVAILABLE_IN_ALL
779 void g_file_query_info_async (GFile *file,
780 const char *attributes,
781 GFileQueryInfoFlags flags,
783 GCancellable *cancellable,
784 GAsyncReadyCallback callback,
786 GLIB_AVAILABLE_IN_ALL
787 GFileInfo * g_file_query_info_finish (GFile *file,
790 GLIB_AVAILABLE_IN_ALL
791 GFileInfo * g_file_query_filesystem_info (GFile *file,
792 const char *attributes,
793 GCancellable *cancellable,
795 GLIB_AVAILABLE_IN_ALL
796 void g_file_query_filesystem_info_async (GFile *file,
797 const char *attributes,
799 GCancellable *cancellable,
800 GAsyncReadyCallback callback,
802 GLIB_AVAILABLE_IN_ALL
803 GFileInfo * g_file_query_filesystem_info_finish (GFile *file,
806 GLIB_AVAILABLE_IN_ALL
807 GMount * g_file_find_enclosing_mount (GFile *file,
808 GCancellable *cancellable,
810 GLIB_AVAILABLE_IN_ALL
811 void g_file_find_enclosing_mount_async (GFile *file,
813 GCancellable *cancellable,
814 GAsyncReadyCallback callback,
816 GLIB_AVAILABLE_IN_ALL
817 GMount * g_file_find_enclosing_mount_finish (GFile *file,
820 GLIB_AVAILABLE_IN_ALL
821 GFileEnumerator * g_file_enumerate_children (GFile *file,
822 const char *attributes,
823 GFileQueryInfoFlags flags,
824 GCancellable *cancellable,
826 GLIB_AVAILABLE_IN_ALL
827 void g_file_enumerate_children_async (GFile *file,
828 const char *attributes,
829 GFileQueryInfoFlags flags,
831 GCancellable *cancellable,
832 GAsyncReadyCallback callback,
834 GLIB_AVAILABLE_IN_ALL
835 GFileEnumerator * g_file_enumerate_children_finish (GFile *file,
838 GLIB_AVAILABLE_IN_ALL
839 GFile * g_file_set_display_name (GFile *file,
840 const char *display_name,
841 GCancellable *cancellable,
843 GLIB_AVAILABLE_IN_ALL
844 void g_file_set_display_name_async (GFile *file,
845 const char *display_name,
847 GCancellable *cancellable,
848 GAsyncReadyCallback callback,
850 GLIB_AVAILABLE_IN_ALL
851 GFile * g_file_set_display_name_finish (GFile *file,
854 GLIB_AVAILABLE_IN_ALL
855 gboolean g_file_delete (GFile *file,
856 GCancellable *cancellable,
859 GLIB_AVAILABLE_IN_2_34
860 void g_file_delete_async (GFile *file,
862 GCancellable *cancellable,
863 GAsyncReadyCallback callback,
866 GLIB_AVAILABLE_IN_2_34
867 gboolean g_file_delete_finish (GFile *file,
868 GAsyncResult *result,
871 GLIB_AVAILABLE_IN_ALL
872 gboolean g_file_trash (GFile *file,
873 GCancellable *cancellable,
876 GLIB_AVAILABLE_IN_2_38
877 void g_file_trash_async (GFile *file,
879 GCancellable *cancellable,
880 GAsyncReadyCallback callback,
883 GLIB_AVAILABLE_IN_2_38
884 gboolean g_file_trash_finish (GFile *file,
885 GAsyncResult *result,
888 GLIB_AVAILABLE_IN_ALL
889 gboolean g_file_copy (GFile *source,
891 GFileCopyFlags flags,
892 GCancellable *cancellable,
893 GFileProgressCallback progress_callback,
894 gpointer progress_callback_data,
896 GLIB_AVAILABLE_IN_ALL
897 void g_file_copy_async (GFile *source,
899 GFileCopyFlags flags,
901 GCancellable *cancellable,
902 GFileProgressCallback progress_callback,
903 gpointer progress_callback_data,
904 GAsyncReadyCallback callback,
906 GLIB_AVAILABLE_IN_ALL
907 gboolean g_file_copy_finish (GFile *file,
910 GLIB_AVAILABLE_IN_ALL
911 gboolean g_file_move (GFile *source,
913 GFileCopyFlags flags,
914 GCancellable *cancellable,
915 GFileProgressCallback progress_callback,
916 gpointer progress_callback_data,
918 GLIB_AVAILABLE_IN_ALL
919 gboolean g_file_make_directory (GFile *file,
920 GCancellable *cancellable,
922 GLIB_AVAILABLE_IN_2_38
923 void g_file_make_directory_async (GFile *file,
925 GCancellable *cancellable,
926 GAsyncReadyCallback callback,
928 GLIB_AVAILABLE_IN_2_38
929 gboolean g_file_make_directory_finish (GFile *file,
930 GAsyncResult *result,
933 GLIB_AVAILABLE_IN_ALL
934 gboolean g_file_make_directory_with_parents (GFile *file,
935 GCancellable *cancellable,
937 GLIB_AVAILABLE_IN_ALL
938 gboolean g_file_make_symbolic_link (GFile *file,
939 const char *symlink_value,
940 GCancellable *cancellable,
942 GLIB_AVAILABLE_IN_ALL
943 GFileAttributeInfoList *g_file_query_settable_attributes (GFile *file,
944 GCancellable *cancellable,
946 GLIB_AVAILABLE_IN_ALL
947 GFileAttributeInfoList *g_file_query_writable_namespaces (GFile *file,
948 GCancellable *cancellable,
950 GLIB_AVAILABLE_IN_ALL
951 gboolean g_file_set_attribute (GFile *file,
952 const char *attribute,
953 GFileAttributeType type,
955 GFileQueryInfoFlags flags,
956 GCancellable *cancellable,
958 GLIB_AVAILABLE_IN_ALL
959 gboolean g_file_set_attributes_from_info (GFile *file,
961 GFileQueryInfoFlags flags,
962 GCancellable *cancellable,
964 GLIB_AVAILABLE_IN_ALL
965 void g_file_set_attributes_async (GFile *file,
967 GFileQueryInfoFlags flags,
969 GCancellable *cancellable,
970 GAsyncReadyCallback callback,
972 GLIB_AVAILABLE_IN_ALL
973 gboolean g_file_set_attributes_finish (GFile *file,
974 GAsyncResult *result,
977 GLIB_AVAILABLE_IN_ALL
978 gboolean g_file_set_attribute_string (GFile *file,
979 const char *attribute,
981 GFileQueryInfoFlags flags,
982 GCancellable *cancellable,
984 GLIB_AVAILABLE_IN_ALL
985 gboolean g_file_set_attribute_byte_string (GFile *file,
986 const char *attribute,
988 GFileQueryInfoFlags flags,
989 GCancellable *cancellable,
991 GLIB_AVAILABLE_IN_ALL
992 gboolean g_file_set_attribute_uint32 (GFile *file,
993 const char *attribute,
995 GFileQueryInfoFlags flags,
996 GCancellable *cancellable,
998 GLIB_AVAILABLE_IN_ALL
999 gboolean g_file_set_attribute_int32 (GFile *file,
1000 const char *attribute,
1002 GFileQueryInfoFlags flags,
1003 GCancellable *cancellable,
1005 GLIB_AVAILABLE_IN_ALL
1006 gboolean g_file_set_attribute_uint64 (GFile *file,
1007 const char *attribute,
1009 GFileQueryInfoFlags flags,
1010 GCancellable *cancellable,
1012 GLIB_AVAILABLE_IN_ALL
1013 gboolean g_file_set_attribute_int64 (GFile *file,
1014 const char *attribute,
1016 GFileQueryInfoFlags flags,
1017 GCancellable *cancellable,
1019 GLIB_AVAILABLE_IN_ALL
1020 void g_file_mount_enclosing_volume (GFile *location,
1021 GMountMountFlags flags,
1022 GMountOperation *mount_operation,
1023 GCancellable *cancellable,
1024 GAsyncReadyCallback callback,
1025 gpointer user_data);
1026 GLIB_AVAILABLE_IN_ALL
1027 gboolean g_file_mount_enclosing_volume_finish (GFile *location,
1028 GAsyncResult *result,
1030 GLIB_AVAILABLE_IN_ALL
1031 void g_file_mount_mountable (GFile *file,
1032 GMountMountFlags flags,
1033 GMountOperation *mount_operation,
1034 GCancellable *cancellable,
1035 GAsyncReadyCallback callback,
1036 gpointer user_data);
1037 GLIB_AVAILABLE_IN_ALL
1038 GFile * g_file_mount_mountable_finish (GFile *file,
1039 GAsyncResult *result,
1041 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
1042 void g_file_unmount_mountable (GFile *file,
1043 GMountUnmountFlags flags,
1044 GCancellable *cancellable,
1045 GAsyncReadyCallback callback,
1046 gpointer user_data);
1048 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
1049 gboolean g_file_unmount_mountable_finish (GFile *file,
1050 GAsyncResult *result,
1052 GLIB_AVAILABLE_IN_ALL
1053 void g_file_unmount_mountable_with_operation (GFile *file,
1054 GMountUnmountFlags flags,
1055 GMountOperation *mount_operation,
1056 GCancellable *cancellable,
1057 GAsyncReadyCallback callback,
1058 gpointer user_data);
1059 GLIB_AVAILABLE_IN_ALL
1060 gboolean g_file_unmount_mountable_with_operation_finish (GFile *file,
1061 GAsyncResult *result,
1063 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1064 void g_file_eject_mountable (GFile *file,
1065 GMountUnmountFlags flags,
1066 GCancellable *cancellable,
1067 GAsyncReadyCallback callback,
1068 gpointer user_data);
1070 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1071 gboolean g_file_eject_mountable_finish (GFile *file,
1072 GAsyncResult *result,
1074 GLIB_AVAILABLE_IN_ALL
1075 void g_file_eject_mountable_with_operation (GFile *file,
1076 GMountUnmountFlags flags,
1077 GMountOperation *mount_operation,
1078 GCancellable *cancellable,
1079 GAsyncReadyCallback callback,
1080 gpointer user_data);
1081 GLIB_AVAILABLE_IN_ALL
1082 gboolean g_file_eject_mountable_with_operation_finish (GFile *file,
1083 GAsyncResult *result,
1086 GLIB_AVAILABLE_IN_ALL
1087 gboolean g_file_copy_attributes (GFile *source,
1089 GFileCopyFlags flags,
1090 GCancellable *cancellable,
1094 GLIB_AVAILABLE_IN_ALL
1095 GFileMonitor* g_file_monitor_directory (GFile *file,
1096 GFileMonitorFlags flags,
1097 GCancellable *cancellable,
1099 GLIB_AVAILABLE_IN_ALL
1100 GFileMonitor* g_file_monitor_file (GFile *file,
1101 GFileMonitorFlags flags,
1102 GCancellable *cancellable,
1104 GLIB_AVAILABLE_IN_ALL
1105 GFileMonitor* g_file_monitor (GFile *file,
1106 GFileMonitorFlags flags,
1107 GCancellable *cancellable,
1110 GLIB_AVAILABLE_IN_2_38
1111 gboolean g_file_measure_disk_usage (GFile *file,
1112 GFileMeasureFlags flags,
1113 GCancellable *cancellable,
1114 GFileMeasureProgressCallback progress_callback,
1115 gpointer progress_data,
1116 guint64 *disk_usage,
1121 GLIB_AVAILABLE_IN_2_38
1122 void g_file_measure_disk_usage_async (GFile *file,
1123 GFileMeasureFlags flags,
1125 GCancellable *cancellable,
1126 GFileMeasureProgressCallback progress_callback,
1127 gpointer progress_data,
1128 GAsyncReadyCallback callback,
1129 gpointer user_data);
1131 GLIB_AVAILABLE_IN_2_38
1132 gboolean g_file_measure_disk_usage_finish (GFile *file,
1133 GAsyncResult *result,
1134 guint64 *disk_usage,
1139 GLIB_AVAILABLE_IN_ALL
1140 void g_file_start_mountable (GFile *file,
1141 GDriveStartFlags flags,
1142 GMountOperation *start_operation,
1143 GCancellable *cancellable,
1144 GAsyncReadyCallback callback,
1145 gpointer user_data);
1146 GLIB_AVAILABLE_IN_ALL
1147 gboolean g_file_start_mountable_finish (GFile *file,
1148 GAsyncResult *result,
1150 GLIB_AVAILABLE_IN_ALL
1151 void g_file_stop_mountable (GFile *file,
1152 GMountUnmountFlags flags,
1153 GMountOperation *mount_operation,
1154 GCancellable *cancellable,
1155 GAsyncReadyCallback callback,
1156 gpointer user_data);
1157 GLIB_AVAILABLE_IN_ALL
1158 gboolean g_file_stop_mountable_finish (GFile *file,
1159 GAsyncResult *result,
1162 GLIB_AVAILABLE_IN_ALL
1163 void g_file_poll_mountable (GFile *file,
1164 GCancellable *cancellable,
1165 GAsyncReadyCallback callback,
1166 gpointer user_data);
1167 GLIB_AVAILABLE_IN_ALL
1168 gboolean g_file_poll_mountable_finish (GFile *file,
1169 GAsyncResult *result,
1174 GLIB_AVAILABLE_IN_ALL
1175 GAppInfo *g_file_query_default_handler (GFile *file,
1176 GCancellable *cancellable,
1178 GLIB_AVAILABLE_IN_ALL
1179 gboolean g_file_load_contents (GFile *file,
1180 GCancellable *cancellable,
1185 GLIB_AVAILABLE_IN_ALL
1186 void g_file_load_contents_async (GFile *file,
1187 GCancellable *cancellable,
1188 GAsyncReadyCallback callback,
1189 gpointer user_data);
1190 GLIB_AVAILABLE_IN_ALL
1191 gboolean g_file_load_contents_finish (GFile *file,
1197 GLIB_AVAILABLE_IN_ALL
1198 void g_file_load_partial_contents_async (GFile *file,
1199 GCancellable *cancellable,
1200 GFileReadMoreCallback read_more_callback,
1201 GAsyncReadyCallback callback,
1202 gpointer user_data);
1203 GLIB_AVAILABLE_IN_ALL
1204 gboolean g_file_load_partial_contents_finish (GFile *file,
1210 GLIB_AVAILABLE_IN_ALL
1211 gboolean g_file_replace_contents (GFile *file,
1212 const char *contents,
1215 gboolean make_backup,
1216 GFileCreateFlags flags,
1218 GCancellable *cancellable,
1220 GLIB_AVAILABLE_IN_ALL
1221 void g_file_replace_contents_async (GFile *file,
1222 const char *contents,
1225 gboolean make_backup,
1226 GFileCreateFlags flags,
1227 GCancellable *cancellable,
1228 GAsyncReadyCallback callback,
1229 gpointer user_data);
1230 GLIB_AVAILABLE_IN_2_40
1231 void g_file_replace_contents_bytes_async (GFile *file,
1234 gboolean make_backup,
1235 GFileCreateFlags flags,
1236 GCancellable *cancellable,
1237 GAsyncReadyCallback callback,
1238 gpointer user_data);
1239 GLIB_AVAILABLE_IN_ALL
1240 gboolean g_file_replace_contents_finish (GFile *file,
1245 GLIB_AVAILABLE_IN_ALL
1246 gboolean g_file_supports_thread_contexts (GFile *file);
1250 #endif /* __G_FILE_H__ */