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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27 #error "Only <gio/gio.h> can be included directly."
30 #include <gio/giotypes.h>
34 #define G_TYPE_FILE (g_file_get_type ())
35 #define G_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
36 #define G_IS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
37 #define G_FILE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
43 * A handle to an object implementing the #GFileIface interface.
44 * Generally stores a location within the file system. Handles do not
45 * necessarily represent files or directories that currently exist.
47 typedef struct _GFile GFile; /* Dummy typedef */
49 typedef struct _GFileIface GFileIface;
54 * @g_iface: The parent interface.
55 * @dup: Duplicates a #GFile.
56 * @hash: Creates a hash of a #GFile.
57 * @equal: Checks equality of two given #GFile<!-- -->s.
58 * @is_native: Checks to see if a file is native to the system.
59 * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
60 * @get_uri_scheme: Gets the URI scheme for a #GFile.
61 * @get_basename: Gets the basename for a given #GFile.
62 * @get_path: Gets the current path within a #GFile.
63 * @get_uri: Gets a URI for the path within a #GFile.
64 * @get_parse_name: Gets the parsed name for the #GFile.
65 * @get_parent: Gets the parent directory for the #GFile.
66 * @prefix_matches: Checks whether a #GFile contains a specified file.
67 * @get_relative_path: Gets the path for a #GFile relative to a given path.
68 * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
69 * @get_child_for_display_name: Gets the child #GFile for a given display name.
70 * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
71 * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
72 * @enumerate_children_finish: Finishes asynchronously enumerating the children.
73 * @query_info: Gets the #GFileInfo for a #GFile.
74 * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
75 * @query_info_finish: Finishes an asynchronous query info operation.
76 * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
77 * @query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
78 * @query_filesystem_info_finish: Finishes asynchronously getting the file system info.
79 * @find_enclosing_mount: Gets a #GMount for the #GFile.
80 * @find_enclosing_mount_async: Asynchronously gets the #GMount for a #GFile.
81 * @find_enclosing_mount_finish: Finishes asynchronously getting the volume.
82 * @set_display_name: Sets the display name for a #GFile.
83 * @set_display_name_async: Asynchronously sets a #GFile's display name.
84 * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
85 * @query_settable_attributes: Returns a list of #GFileAttribute<!-- -->s that can be set.
86 * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttribute<!-- -->s that can be set.
87 * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
88 * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable.
89 * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable.
90 * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
91 * @set_attribute: Sets a #GFileAttribute.
92 * @set_attributes_from_info: Sets a #GFileAttribute with information from a #GFileInfo.
93 * @set_attributes_async: Asynchronously sets a file's attributes.
94 * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
95 * @read_fn: Reads a file asynchronously.
96 * @read_async: Asynchronously reads a file.
97 * @read_finish: Finishes asynchronously reading a file.
98 * @append_to: Writes to the end of a file.
99 * @append_to_async: Asynchronously writes to the end of a file.
100 * @append_to_finish: Finishes an asynchronous file append operation.
101 * @create: Creates a new file.
102 * @create_async: Asynchronously creates a file.
103 * @create_finish: Finishes asynchronously creating a file.
104 * @replace: Replaces the contents of a file.
105 * @replace_async: Asynchronously replaces the contents of a file.
106 * @replace_finish: Finishes asynchronously replacing a file.
107 * @delete_file: Deletes a file.
108 * @delete_file_async: Asynchronously deletes a file.
109 * @delete_file_finish: Finishes an asynchronous delete.
110 * @trash: Sends a #GFile to the Trash location.
111 * @_trash_async: Asynchronously sends a #GFile to the Trash location.
112 * @_trash_finish: Finishes an asynchronous file trashing operation.
113 * @make_directory: Makes a directory.
114 * @_make_directory_async: Asynchronously makes a directory.
115 * @_make_directory_finish: Finishes making a directory asynchronously.
116 * @make_symbolic_link: Makes a symbolic link.
117 * @_make_symbolic_link_async: Asynchronously makes a symbolic link
118 * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
119 * @copy: Copies a file.
120 * @copy_async: Asynchronously copies a file.
121 * @copy_finish: Finishes an asynchronous copy operation.
122 * @move: Moves a file.
123 * @_move_async: Asynchronously moves a file.
124 * @_move_finish: Finishes an asynchronous move operation.
125 * @mount_mountable: Mounts a mountable object.
126 * @mount_mountable_finish: Finishes a mounting operation.
127 * @unmount_mountable: Unmounts a mountable object.
128 * @unmount_mountable_finish: Finishes an unmount operation.
129 * @eject_mountable: Ejects a mountable.
130 * @eject_mountable_finish: Finishes an eject operation.
131 * @mount_enclosing_volume: Mounts a specified location.
132 * @mount_enclosing_volume_finish: Finishes mounting a specified location.
133 * @monitor_dir: Creates a #GFileMonitor for the location.
134 * @monitor_file: Creates a #GFileMonitor for the location.
135 * @open_readwrite: Open file read/write. Since 2.22.
136 * @open_readwrite_async: Asynchronously opens file read/write. Since 2.22.
137 * @open_readwrite_finish: Finishes an asynchronous open read/write. Since 2.22.
138 * @create_readwrite: Creates file read/write. Since 2.22.
139 * @create_readwrite_async: Asynchronously creates file read/write. Since 2.22.
140 * @create_readwrite_finish: Finishes an asynchronous creates read/write. Since 2.22.
141 * @replace_readwrite: Replaces file read/write. Since 2.22.
142 * @replace_readwrite_async: Asynchronously replaces file read/write. Since 2.22.
143 * @replace_readwrite_finish: Finishes an asynchronous replace read/write. Since 2.22.
144 * @start_mountable: Starts a mountable object. Since 2.22.
145 * @start_mountable_finish: Finishes an start operation. Since 2.22.
146 * @stop_mountable: Stops a mountable. Since 2.22.
147 * @stop_mountable_finish: Finishes an stop operation. Since 2.22.
148 * @supports_thread_contexts: a boolean that indicates whether the #GFile implementation supports thread-default contexts. Since 2.22.
149 * @unmount_mountable_with_operation: Unmounts a mountable object using a #GMountOperation. Since 2.22.
150 * @unmount_mountable_with_operation_finish: Finishes an unmount operation using a #GMountOperation. Since 2.22.
151 * @eject_mountable_with_operation: Ejects a mountable object using a #GMountOperation. Since 2.22.
152 * @eject_mountable_with_operation_finish: Finishes an eject operation using a #GMountOperation. Since 2.22.
153 * @poll_mountable: Polls a mountable object for media changes. Since 2.22.
154 * @poll_mountable_finish: Finishes an poll operation for media changes. Since 2.22.
156 * An interface for writing VFS file handles.
160 GTypeInterface g_iface;
164 GFile * (* dup) (GFile *file);
165 guint (* hash) (GFile *file);
166 gboolean (* equal) (GFile *file1,
168 gboolean (* is_native) (GFile *file);
169 gboolean (* has_uri_scheme) (GFile *file,
170 const char *uri_scheme);
171 char * (* get_uri_scheme) (GFile *file);
172 char * (* get_basename) (GFile *file);
173 char * (* get_path) (GFile *file);
174 char * (* get_uri) (GFile *file);
175 char * (* get_parse_name) (GFile *file);
176 GFile * (* get_parent) (GFile *file);
177 gboolean (* prefix_matches) (GFile *prefix,
179 char * (* get_relative_path) (GFile *parent,
181 GFile * (* resolve_relative_path) (GFile *file,
182 const char *relative_path);
183 GFile * (* get_child_for_display_name) (GFile *file,
184 const char *display_name,
187 GFileEnumerator * (* enumerate_children) (GFile *file,
188 const char *attributes,
189 GFileQueryInfoFlags flags,
190 GCancellable *cancellable,
192 void (* enumerate_children_async) (GFile *file,
193 const char *attributes,
194 GFileQueryInfoFlags flags,
196 GCancellable *cancellable,
197 GAsyncReadyCallback callback,
199 GFileEnumerator * (* enumerate_children_finish) (GFile *file,
203 GFileInfo * (* query_info) (GFile *file,
204 const char *attributes,
205 GFileQueryInfoFlags flags,
206 GCancellable *cancellable,
208 void (* query_info_async) (GFile *file,
209 const char *attributes,
210 GFileQueryInfoFlags flags,
212 GCancellable *cancellable,
213 GAsyncReadyCallback callback,
215 GFileInfo * (* query_info_finish) (GFile *file,
219 GFileInfo * (* query_filesystem_info) (GFile *file,
220 const char *attributes,
221 GCancellable *cancellable,
223 void (* query_filesystem_info_async) (GFile *file,
224 const char *attributes,
226 GCancellable *cancellable,
227 GAsyncReadyCallback callback,
229 GFileInfo * (* query_filesystem_info_finish)(GFile *file,
233 GMount * (* find_enclosing_mount) (GFile *file,
234 GCancellable *cancellable,
236 void (* find_enclosing_mount_async) (GFile *file,
238 GCancellable *cancellable,
239 GAsyncReadyCallback callback,
241 GMount * (* find_enclosing_mount_finish) (GFile *file,
245 GFile * (* set_display_name) (GFile *file,
246 const char *display_name,
247 GCancellable *cancellable,
249 void (* set_display_name_async) (GFile *file,
250 const char *display_name,
252 GCancellable *cancellable,
253 GAsyncReadyCallback callback,
255 GFile * (* set_display_name_finish) (GFile *file,
259 GFileAttributeInfoList * (* query_settable_attributes) (GFile *file,
260 GCancellable *cancellable,
262 void (* _query_settable_attributes_async) (void);
263 void (* _query_settable_attributes_finish) (void);
265 GFileAttributeInfoList * (* query_writable_namespaces) (GFile *file,
266 GCancellable *cancellable,
268 void (* _query_writable_namespaces_async) (void);
269 void (* _query_writable_namespaces_finish) (void);
271 gboolean (* set_attribute) (GFile *file,
272 const char *attribute,
273 GFileAttributeType type,
275 GFileQueryInfoFlags flags,
276 GCancellable *cancellable,
278 gboolean (* set_attributes_from_info) (GFile *file,
280 GFileQueryInfoFlags flags,
281 GCancellable *cancellable,
283 void (* set_attributes_async) (GFile *file,
285 GFileQueryInfoFlags flags,
287 GCancellable *cancellable,
288 GAsyncReadyCallback callback,
290 gboolean (* set_attributes_finish) (GFile *file,
291 GAsyncResult *result,
295 GFileInputStream * (* read_fn) (GFile *file,
296 GCancellable *cancellable,
298 void (* read_async) (GFile *file,
300 GCancellable *cancellable,
301 GAsyncReadyCallback callback,
303 GFileInputStream * (* read_finish) (GFile *file,
307 GFileOutputStream * (* append_to) (GFile *file,
308 GFileCreateFlags flags,
309 GCancellable *cancellable,
311 void (* append_to_async) (GFile *file,
312 GFileCreateFlags flags,
314 GCancellable *cancellable,
315 GAsyncReadyCallback callback,
317 GFileOutputStream * (* append_to_finish) (GFile *file,
321 GFileOutputStream * (* create) (GFile *file,
322 GFileCreateFlags flags,
323 GCancellable *cancellable,
325 void (* create_async) (GFile *file,
326 GFileCreateFlags flags,
328 GCancellable *cancellable,
329 GAsyncReadyCallback callback,
331 GFileOutputStream * (* create_finish) (GFile *file,
335 GFileOutputStream * (* replace) (GFile *file,
337 gboolean make_backup,
338 GFileCreateFlags flags,
339 GCancellable *cancellable,
341 void (* replace_async) (GFile *file,
343 gboolean make_backup,
344 GFileCreateFlags flags,
346 GCancellable *cancellable,
347 GAsyncReadyCallback callback,
349 GFileOutputStream * (* replace_finish) (GFile *file,
353 gboolean (* delete_file) (GFile *file,
354 GCancellable *cancellable,
356 void (* delete_file_async) (GFile *file,
358 GCancellable *cancellable,
359 GAsyncReadyCallback callback,
361 gboolean (* delete_file_finish) (GFile *file,
362 GAsyncResult *result,
365 gboolean (* trash) (GFile *file,
366 GCancellable *cancellable,
368 void (* _trash_async) (void);
369 void (* _trash_finish) (void);
371 gboolean (* make_directory) (GFile *file,
372 GCancellable *cancellable,
374 void (* _make_directory_async) (void);
375 void (* _make_directory_finish) (void);
377 gboolean (* make_symbolic_link) (GFile *file,
378 const char *symlink_value,
379 GCancellable *cancellable,
381 void (* _make_symbolic_link_async) (void);
382 void (* _make_symbolic_link_finish) (void);
384 gboolean (* copy) (GFile *source,
386 GFileCopyFlags flags,
387 GCancellable *cancellable,
388 GFileProgressCallback progress_callback,
389 gpointer progress_callback_data,
391 void (* copy_async) (GFile *source,
393 GFileCopyFlags flags,
395 GCancellable *cancellable,
396 GFileProgressCallback progress_callback,
397 gpointer progress_callback_data,
398 GAsyncReadyCallback callback,
400 gboolean (* copy_finish) (GFile *file,
404 gboolean (* move) (GFile *source,
406 GFileCopyFlags flags,
407 GCancellable *cancellable,
408 GFileProgressCallback progress_callback,
409 gpointer progress_callback_data,
411 void (* _move_async) (void);
412 void (* _move_finish) (void);
414 void (* mount_mountable) (GFile *file,
415 GMountMountFlags flags,
416 GMountOperation *mount_operation,
417 GCancellable *cancellable,
418 GAsyncReadyCallback callback,
420 GFile * (* mount_mountable_finish) (GFile *file,
421 GAsyncResult *result,
424 void (* unmount_mountable) (GFile *file,
425 GMountUnmountFlags flags,
426 GCancellable *cancellable,
427 GAsyncReadyCallback callback,
429 gboolean (* unmount_mountable_finish) (GFile *file,
430 GAsyncResult *result,
433 void (* eject_mountable) (GFile *file,
434 GMountUnmountFlags flags,
435 GCancellable *cancellable,
436 GAsyncReadyCallback callback,
438 gboolean (* eject_mountable_finish) (GFile *file,
439 GAsyncResult *result,
442 void (* mount_enclosing_volume) (GFile *location,
443 GMountMountFlags flags,
444 GMountOperation *mount_operation,
445 GCancellable *cancellable,
446 GAsyncReadyCallback callback,
448 gboolean (* mount_enclosing_volume_finish) (GFile *location,
449 GAsyncResult *result,
452 GFileMonitor * (* monitor_dir) (GFile *file,
453 GFileMonitorFlags flags,
454 GCancellable *cancellable,
456 GFileMonitor * (* monitor_file) (GFile *file,
457 GFileMonitorFlags flags,
458 GCancellable *cancellable,
461 GFileIOStream * (* open_readwrite) (GFile *file,
462 GCancellable *cancellable,
464 void (* open_readwrite_async) (GFile *file,
466 GCancellable *cancellable,
467 GAsyncReadyCallback callback,
469 GFileIOStream * (* open_readwrite_finish) (GFile *file,
472 GFileIOStream * (* create_readwrite) (GFile *file,
473 GFileCreateFlags flags,
474 GCancellable *cancellable,
476 void (* create_readwrite_async) (GFile *file,
477 GFileCreateFlags flags,
479 GCancellable *cancellable,
480 GAsyncReadyCallback callback,
482 GFileIOStream * (* create_readwrite_finish) (GFile *file,
485 GFileIOStream * (* replace_readwrite) (GFile *file,
487 gboolean make_backup,
488 GFileCreateFlags flags,
489 GCancellable *cancellable,
491 void (* replace_readwrite_async) (GFile *file,
493 gboolean make_backup,
494 GFileCreateFlags flags,
496 GCancellable *cancellable,
497 GAsyncReadyCallback callback,
499 GFileIOStream * (* replace_readwrite_finish) (GFile *file,
503 void (* start_mountable) (GFile *file,
504 GDriveStartFlags flags,
505 GMountOperation *start_operation,
506 GCancellable *cancellable,
507 GAsyncReadyCallback callback,
509 gboolean (* start_mountable_finish) (GFile *file,
510 GAsyncResult *result,
513 void (* stop_mountable) (GFile *file,
514 GMountUnmountFlags flags,
515 GMountOperation *mount_operation,
516 GCancellable *cancellable,
517 GAsyncReadyCallback callback,
519 gboolean (* stop_mountable_finish) (GFile *file,
520 GAsyncResult *result,
523 gboolean supports_thread_contexts;
525 void (* unmount_mountable_with_operation) (GFile *file,
526 GMountUnmountFlags flags,
527 GMountOperation *mount_operation,
528 GCancellable *cancellable,
529 GAsyncReadyCallback callback,
531 gboolean (* unmount_mountable_with_operation_finish) (GFile *file,
532 GAsyncResult *result,
535 void (* eject_mountable_with_operation) (GFile *file,
536 GMountUnmountFlags flags,
537 GMountOperation *mount_operation,
538 GCancellable *cancellable,
539 GAsyncReadyCallback callback,
541 gboolean (* eject_mountable_with_operation_finish) (GFile *file,
542 GAsyncResult *result,
545 void (* poll_mountable) (GFile *file,
546 GCancellable *cancellable,
547 GAsyncReadyCallback callback,
549 gboolean (* poll_mountable_finish) (GFile *file,
550 GAsyncResult *result,
554 GLIB_AVAILABLE_IN_ALL
555 GType g_file_get_type (void) G_GNUC_CONST;
557 GLIB_AVAILABLE_IN_ALL
558 GFile * g_file_new_for_path (const char *path);
559 GLIB_AVAILABLE_IN_ALL
560 GFile * g_file_new_for_uri (const char *uri);
561 GLIB_AVAILABLE_IN_ALL
562 GFile * g_file_new_for_commandline_arg (const char *arg);
563 GLIB_AVAILABLE_IN_2_36
564 GFile * g_file_new_for_commandline_arg_and_cwd (const gchar *arg,
566 GLIB_AVAILABLE_IN_2_32
567 GFile * g_file_new_tmp (const char *tmpl,
568 GFileIOStream **iostream,
570 GLIB_AVAILABLE_IN_ALL
571 GFile * g_file_parse_name (const char *parse_name);
572 GLIB_AVAILABLE_IN_ALL
573 GFile * g_file_dup (GFile *file);
574 GLIB_AVAILABLE_IN_ALL
575 guint g_file_hash (gconstpointer file);
576 GLIB_AVAILABLE_IN_ALL
577 gboolean g_file_equal (GFile *file1,
579 GLIB_AVAILABLE_IN_ALL
580 char * g_file_get_basename (GFile *file);
581 GLIB_AVAILABLE_IN_ALL
582 char * g_file_get_path (GFile *file);
583 GLIB_AVAILABLE_IN_ALL
584 char * g_file_get_uri (GFile *file);
585 GLIB_AVAILABLE_IN_ALL
586 char * g_file_get_parse_name (GFile *file);
587 GLIB_AVAILABLE_IN_ALL
588 GFile * g_file_get_parent (GFile *file);
589 GLIB_AVAILABLE_IN_ALL
590 gboolean g_file_has_parent (GFile *file,
592 GLIB_AVAILABLE_IN_ALL
593 GFile * g_file_get_child (GFile *file,
595 GLIB_AVAILABLE_IN_ALL
596 GFile * g_file_get_child_for_display_name (GFile *file,
597 const char *display_name,
599 GLIB_AVAILABLE_IN_ALL
600 gboolean g_file_has_prefix (GFile *file,
602 GLIB_AVAILABLE_IN_ALL
603 char * g_file_get_relative_path (GFile *parent,
605 GLIB_AVAILABLE_IN_ALL
606 GFile * g_file_resolve_relative_path (GFile *file,
607 const char *relative_path);
608 GLIB_AVAILABLE_IN_ALL
609 gboolean g_file_is_native (GFile *file);
610 GLIB_AVAILABLE_IN_ALL
611 gboolean g_file_has_uri_scheme (GFile *file,
612 const char *uri_scheme);
613 GLIB_AVAILABLE_IN_ALL
614 char * g_file_get_uri_scheme (GFile *file);
615 GLIB_AVAILABLE_IN_ALL
616 GFileInputStream * g_file_read (GFile *file,
617 GCancellable *cancellable,
619 GLIB_AVAILABLE_IN_ALL
620 void g_file_read_async (GFile *file,
622 GCancellable *cancellable,
623 GAsyncReadyCallback callback,
625 GLIB_AVAILABLE_IN_ALL
626 GFileInputStream * g_file_read_finish (GFile *file,
629 GLIB_AVAILABLE_IN_ALL
630 GFileOutputStream * g_file_append_to (GFile *file,
631 GFileCreateFlags flags,
632 GCancellable *cancellable,
634 GLIB_AVAILABLE_IN_ALL
635 GFileOutputStream * g_file_create (GFile *file,
636 GFileCreateFlags flags,
637 GCancellable *cancellable,
639 GLIB_AVAILABLE_IN_ALL
640 GFileOutputStream * g_file_replace (GFile *file,
642 gboolean make_backup,
643 GFileCreateFlags flags,
644 GCancellable *cancellable,
646 GLIB_AVAILABLE_IN_ALL
647 void g_file_append_to_async (GFile *file,
648 GFileCreateFlags flags,
650 GCancellable *cancellable,
651 GAsyncReadyCallback callback,
653 GLIB_AVAILABLE_IN_ALL
654 GFileOutputStream * g_file_append_to_finish (GFile *file,
657 GLIB_AVAILABLE_IN_ALL
658 void g_file_create_async (GFile *file,
659 GFileCreateFlags flags,
661 GCancellable *cancellable,
662 GAsyncReadyCallback callback,
664 GLIB_AVAILABLE_IN_ALL
665 GFileOutputStream * g_file_create_finish (GFile *file,
668 GLIB_AVAILABLE_IN_ALL
669 void g_file_replace_async (GFile *file,
671 gboolean make_backup,
672 GFileCreateFlags flags,
674 GCancellable *cancellable,
675 GAsyncReadyCallback callback,
677 GLIB_AVAILABLE_IN_ALL
678 GFileOutputStream * g_file_replace_finish (GFile *file,
681 GLIB_AVAILABLE_IN_ALL
682 GFileIOStream * g_file_open_readwrite (GFile *file,
683 GCancellable *cancellable,
685 GLIB_AVAILABLE_IN_ALL
686 void g_file_open_readwrite_async (GFile *file,
688 GCancellable *cancellable,
689 GAsyncReadyCallback callback,
691 GLIB_AVAILABLE_IN_ALL
692 GFileIOStream * g_file_open_readwrite_finish (GFile *file,
695 GLIB_AVAILABLE_IN_ALL
696 GFileIOStream * g_file_create_readwrite (GFile *file,
697 GFileCreateFlags flags,
698 GCancellable *cancellable,
700 GLIB_AVAILABLE_IN_ALL
701 void g_file_create_readwrite_async (GFile *file,
702 GFileCreateFlags flags,
704 GCancellable *cancellable,
705 GAsyncReadyCallback callback,
707 GLIB_AVAILABLE_IN_ALL
708 GFileIOStream * g_file_create_readwrite_finish (GFile *file,
711 GLIB_AVAILABLE_IN_ALL
712 GFileIOStream * g_file_replace_readwrite (GFile *file,
714 gboolean make_backup,
715 GFileCreateFlags flags,
716 GCancellable *cancellable,
718 GLIB_AVAILABLE_IN_ALL
719 void g_file_replace_readwrite_async (GFile *file,
721 gboolean make_backup,
722 GFileCreateFlags flags,
724 GCancellable *cancellable,
725 GAsyncReadyCallback callback,
727 GLIB_AVAILABLE_IN_ALL
728 GFileIOStream * g_file_replace_readwrite_finish (GFile *file,
731 GLIB_AVAILABLE_IN_ALL
732 gboolean g_file_query_exists (GFile *file,
733 GCancellable *cancellable);
734 GLIB_AVAILABLE_IN_ALL
735 GFileType g_file_query_file_type (GFile *file,
736 GFileQueryInfoFlags flags,
737 GCancellable *cancellable);
738 GLIB_AVAILABLE_IN_ALL
739 GFileInfo * g_file_query_info (GFile *file,
740 const char *attributes,
741 GFileQueryInfoFlags flags,
742 GCancellable *cancellable,
744 GLIB_AVAILABLE_IN_ALL
745 void g_file_query_info_async (GFile *file,
746 const char *attributes,
747 GFileQueryInfoFlags flags,
749 GCancellable *cancellable,
750 GAsyncReadyCallback callback,
752 GLIB_AVAILABLE_IN_ALL
753 GFileInfo * g_file_query_info_finish (GFile *file,
756 GLIB_AVAILABLE_IN_ALL
757 GFileInfo * g_file_query_filesystem_info (GFile *file,
758 const char *attributes,
759 GCancellable *cancellable,
761 GLIB_AVAILABLE_IN_ALL
762 void g_file_query_filesystem_info_async (GFile *file,
763 const char *attributes,
765 GCancellable *cancellable,
766 GAsyncReadyCallback callback,
768 GLIB_AVAILABLE_IN_ALL
769 GFileInfo * g_file_query_filesystem_info_finish (GFile *file,
772 GLIB_AVAILABLE_IN_ALL
773 GMount * g_file_find_enclosing_mount (GFile *file,
774 GCancellable *cancellable,
776 GLIB_AVAILABLE_IN_ALL
777 void g_file_find_enclosing_mount_async (GFile *file,
779 GCancellable *cancellable,
780 GAsyncReadyCallback callback,
782 GLIB_AVAILABLE_IN_ALL
783 GMount * g_file_find_enclosing_mount_finish (GFile *file,
786 GLIB_AVAILABLE_IN_ALL
787 GFileEnumerator * g_file_enumerate_children (GFile *file,
788 const char *attributes,
789 GFileQueryInfoFlags flags,
790 GCancellable *cancellable,
792 GLIB_AVAILABLE_IN_ALL
793 void g_file_enumerate_children_async (GFile *file,
794 const char *attributes,
795 GFileQueryInfoFlags flags,
797 GCancellable *cancellable,
798 GAsyncReadyCallback callback,
800 GLIB_AVAILABLE_IN_ALL
801 GFileEnumerator * g_file_enumerate_children_finish (GFile *file,
804 GLIB_AVAILABLE_IN_ALL
805 GFile * g_file_set_display_name (GFile *file,
806 const char *display_name,
807 GCancellable *cancellable,
809 GLIB_AVAILABLE_IN_ALL
810 void g_file_set_display_name_async (GFile *file,
811 const char *display_name,
813 GCancellable *cancellable,
814 GAsyncReadyCallback callback,
816 GLIB_AVAILABLE_IN_ALL
817 GFile * g_file_set_display_name_finish (GFile *file,
820 GLIB_AVAILABLE_IN_ALL
821 gboolean g_file_delete (GFile *file,
822 GCancellable *cancellable,
825 GLIB_AVAILABLE_IN_2_34
826 void g_file_delete_async (GFile *file,
828 GCancellable *cancellable,
829 GAsyncReadyCallback callback,
832 GLIB_AVAILABLE_IN_2_34
833 gboolean g_file_delete_finish (GFile *file,
834 GAsyncResult *result,
837 GLIB_AVAILABLE_IN_ALL
838 gboolean g_file_trash (GFile *file,
839 GCancellable *cancellable,
841 GLIB_AVAILABLE_IN_ALL
842 gboolean g_file_copy (GFile *source,
844 GFileCopyFlags flags,
845 GCancellable *cancellable,
846 GFileProgressCallback progress_callback,
847 gpointer progress_callback_data,
849 GLIB_AVAILABLE_IN_ALL
850 void g_file_copy_async (GFile *source,
852 GFileCopyFlags flags,
854 GCancellable *cancellable,
855 GFileProgressCallback progress_callback,
856 gpointer progress_callback_data,
857 GAsyncReadyCallback callback,
859 GLIB_AVAILABLE_IN_ALL
860 gboolean g_file_copy_finish (GFile *file,
863 GLIB_AVAILABLE_IN_ALL
864 gboolean g_file_move (GFile *source,
866 GFileCopyFlags flags,
867 GCancellable *cancellable,
868 GFileProgressCallback progress_callback,
869 gpointer progress_callback_data,
871 GLIB_AVAILABLE_IN_ALL
872 gboolean g_file_make_directory (GFile *file,
873 GCancellable *cancellable,
875 GLIB_AVAILABLE_IN_ALL
876 gboolean g_file_make_directory_with_parents (GFile *file,
877 GCancellable *cancellable,
879 GLIB_AVAILABLE_IN_ALL
880 gboolean g_file_make_symbolic_link (GFile *file,
881 const char *symlink_value,
882 GCancellable *cancellable,
884 GLIB_AVAILABLE_IN_ALL
885 GFileAttributeInfoList *g_file_query_settable_attributes (GFile *file,
886 GCancellable *cancellable,
888 GLIB_AVAILABLE_IN_ALL
889 GFileAttributeInfoList *g_file_query_writable_namespaces (GFile *file,
890 GCancellable *cancellable,
892 GLIB_AVAILABLE_IN_ALL
893 gboolean g_file_set_attribute (GFile *file,
894 const char *attribute,
895 GFileAttributeType type,
897 GFileQueryInfoFlags flags,
898 GCancellable *cancellable,
900 GLIB_AVAILABLE_IN_ALL
901 gboolean g_file_set_attributes_from_info (GFile *file,
903 GFileQueryInfoFlags flags,
904 GCancellable *cancellable,
906 GLIB_AVAILABLE_IN_ALL
907 void g_file_set_attributes_async (GFile *file,
909 GFileQueryInfoFlags flags,
911 GCancellable *cancellable,
912 GAsyncReadyCallback callback,
914 GLIB_AVAILABLE_IN_ALL
915 gboolean g_file_set_attributes_finish (GFile *file,
916 GAsyncResult *result,
919 GLIB_AVAILABLE_IN_ALL
920 gboolean g_file_set_attribute_string (GFile *file,
921 const char *attribute,
923 GFileQueryInfoFlags flags,
924 GCancellable *cancellable,
926 GLIB_AVAILABLE_IN_ALL
927 gboolean g_file_set_attribute_byte_string (GFile *file,
928 const char *attribute,
930 GFileQueryInfoFlags flags,
931 GCancellable *cancellable,
933 GLIB_AVAILABLE_IN_ALL
934 gboolean g_file_set_attribute_uint32 (GFile *file,
935 const char *attribute,
937 GFileQueryInfoFlags flags,
938 GCancellable *cancellable,
940 GLIB_AVAILABLE_IN_ALL
941 gboolean g_file_set_attribute_int32 (GFile *file,
942 const char *attribute,
944 GFileQueryInfoFlags flags,
945 GCancellable *cancellable,
947 GLIB_AVAILABLE_IN_ALL
948 gboolean g_file_set_attribute_uint64 (GFile *file,
949 const char *attribute,
951 GFileQueryInfoFlags flags,
952 GCancellable *cancellable,
954 GLIB_AVAILABLE_IN_ALL
955 gboolean g_file_set_attribute_int64 (GFile *file,
956 const char *attribute,
958 GFileQueryInfoFlags flags,
959 GCancellable *cancellable,
961 GLIB_AVAILABLE_IN_ALL
962 void g_file_mount_enclosing_volume (GFile *location,
963 GMountMountFlags flags,
964 GMountOperation *mount_operation,
965 GCancellable *cancellable,
966 GAsyncReadyCallback callback,
968 GLIB_AVAILABLE_IN_ALL
969 gboolean g_file_mount_enclosing_volume_finish (GFile *location,
970 GAsyncResult *result,
972 GLIB_AVAILABLE_IN_ALL
973 void g_file_mount_mountable (GFile *file,
974 GMountMountFlags flags,
975 GMountOperation *mount_operation,
976 GCancellable *cancellable,
977 GAsyncReadyCallback callback,
979 GLIB_AVAILABLE_IN_ALL
980 GFile * g_file_mount_mountable_finish (GFile *file,
981 GAsyncResult *result,
983 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation)
984 void g_file_unmount_mountable (GFile *file,
985 GMountUnmountFlags flags,
986 GCancellable *cancellable,
987 GAsyncReadyCallback callback,
990 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish)
991 gboolean g_file_unmount_mountable_finish (GFile *file,
992 GAsyncResult *result,
994 GLIB_AVAILABLE_IN_ALL
995 void g_file_unmount_mountable_with_operation (GFile *file,
996 GMountUnmountFlags flags,
997 GMountOperation *mount_operation,
998 GCancellable *cancellable,
999 GAsyncReadyCallback callback,
1000 gpointer user_data);
1001 GLIB_AVAILABLE_IN_ALL
1002 gboolean g_file_unmount_mountable_with_operation_finish (GFile *file,
1003 GAsyncResult *result,
1005 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation)
1006 void g_file_eject_mountable (GFile *file,
1007 GMountUnmountFlags flags,
1008 GCancellable *cancellable,
1009 GAsyncReadyCallback callback,
1010 gpointer user_data);
1012 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish)
1013 gboolean g_file_eject_mountable_finish (GFile *file,
1014 GAsyncResult *result,
1016 GLIB_AVAILABLE_IN_ALL
1017 void g_file_eject_mountable_with_operation (GFile *file,
1018 GMountUnmountFlags flags,
1019 GMountOperation *mount_operation,
1020 GCancellable *cancellable,
1021 GAsyncReadyCallback callback,
1022 gpointer user_data);
1023 GLIB_AVAILABLE_IN_ALL
1024 gboolean g_file_eject_mountable_with_operation_finish (GFile *file,
1025 GAsyncResult *result,
1028 GLIB_AVAILABLE_IN_ALL
1029 gboolean g_file_copy_attributes (GFile *source,
1031 GFileCopyFlags flags,
1032 GCancellable *cancellable,
1036 GLIB_AVAILABLE_IN_ALL
1037 GFileMonitor* g_file_monitor_directory (GFile *file,
1038 GFileMonitorFlags flags,
1039 GCancellable *cancellable,
1041 GLIB_AVAILABLE_IN_ALL
1042 GFileMonitor* g_file_monitor_file (GFile *file,
1043 GFileMonitorFlags flags,
1044 GCancellable *cancellable,
1046 GLIB_AVAILABLE_IN_ALL
1047 GFileMonitor* g_file_monitor (GFile *file,
1048 GFileMonitorFlags flags,
1049 GCancellable *cancellable,
1052 GLIB_AVAILABLE_IN_ALL
1053 void g_file_start_mountable (GFile *file,
1054 GDriveStartFlags flags,
1055 GMountOperation *start_operation,
1056 GCancellable *cancellable,
1057 GAsyncReadyCallback callback,
1058 gpointer user_data);
1059 GLIB_AVAILABLE_IN_ALL
1060 gboolean g_file_start_mountable_finish (GFile *file,
1061 GAsyncResult *result,
1063 GLIB_AVAILABLE_IN_ALL
1064 void g_file_stop_mountable (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_stop_mountable_finish (GFile *file,
1072 GAsyncResult *result,
1075 GLIB_AVAILABLE_IN_ALL
1076 void g_file_poll_mountable (GFile *file,
1077 GCancellable *cancellable,
1078 GAsyncReadyCallback callback,
1079 gpointer user_data);
1080 GLIB_AVAILABLE_IN_ALL
1081 gboolean g_file_poll_mountable_finish (GFile *file,
1082 GAsyncResult *result,
1087 GLIB_AVAILABLE_IN_ALL
1088 GAppInfo *g_file_query_default_handler (GFile *file,
1089 GCancellable *cancellable,
1091 GLIB_AVAILABLE_IN_ALL
1092 gboolean g_file_load_contents (GFile *file,
1093 GCancellable *cancellable,
1098 GLIB_AVAILABLE_IN_ALL
1099 void g_file_load_contents_async (GFile *file,
1100 GCancellable *cancellable,
1101 GAsyncReadyCallback callback,
1102 gpointer user_data);
1103 GLIB_AVAILABLE_IN_ALL
1104 gboolean g_file_load_contents_finish (GFile *file,
1110 GLIB_AVAILABLE_IN_ALL
1111 void g_file_load_partial_contents_async (GFile *file,
1112 GCancellable *cancellable,
1113 GFileReadMoreCallback read_more_callback,
1114 GAsyncReadyCallback callback,
1115 gpointer user_data);
1116 GLIB_AVAILABLE_IN_ALL
1117 gboolean g_file_load_partial_contents_finish (GFile *file,
1123 GLIB_AVAILABLE_IN_ALL
1124 gboolean g_file_replace_contents (GFile *file,
1125 const char *contents,
1128 gboolean make_backup,
1129 GFileCreateFlags flags,
1131 GCancellable *cancellable,
1133 GLIB_AVAILABLE_IN_ALL
1134 void g_file_replace_contents_async (GFile *file,
1135 const char *contents,
1138 gboolean make_backup,
1139 GFileCreateFlags flags,
1140 GCancellable *cancellable,
1141 GAsyncReadyCallback callback,
1142 gpointer user_data);
1143 GLIB_AVAILABLE_IN_ALL
1144 gboolean g_file_replace_contents_finish (GFile *file,
1149 GLIB_AVAILABLE_IN_ALL
1150 gboolean g_file_supports_thread_contexts (GFile *file);
1154 #endif /* __G_FILE_H__ */