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 #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.
153 * @measure_disk_usage: Recursively measures the disk usage of @file. Since 2.38
154 * @measure_disk_usage_async: Asynchronously recursively measures the disk usage of @file. Since 2.38
155 * @measure_disk_usage_finish: Finishes an asynchronous recursive measurement of the disk usage of @file. Since 2.38
157 * An interface for writing VFS file handles.
161 GTypeInterface g_iface
;
165 GFile
* (* dup
) (GFile
*file
);
166 guint (* hash
) (GFile
*file
);
167 gboolean (* equal
) (GFile
*file1
,
169 gboolean (* is_native
) (GFile
*file
);
170 gboolean (* has_uri_scheme
) (GFile
*file
,
171 const char *uri_scheme
);
172 char * (* get_uri_scheme
) (GFile
*file
);
173 char * (* get_basename
) (GFile
*file
);
174 char * (* get_path
) (GFile
*file
);
175 char * (* get_uri
) (GFile
*file
);
176 char * (* get_parse_name
) (GFile
*file
);
177 GFile
* (* get_parent
) (GFile
*file
);
178 gboolean (* prefix_matches
) (GFile
*prefix
,
180 char * (* get_relative_path
) (GFile
*parent
,
182 GFile
* (* resolve_relative_path
) (GFile
*file
,
183 const char *relative_path
);
184 GFile
* (* get_child_for_display_name
) (GFile
*file
,
185 const char *display_name
,
188 GFileEnumerator
* (* enumerate_children
) (GFile
*file
,
189 const char *attributes
,
190 GFileQueryInfoFlags flags
,
191 GCancellable
*cancellable
,
193 void (* enumerate_children_async
) (GFile
*file
,
194 const char *attributes
,
195 GFileQueryInfoFlags flags
,
197 GCancellable
*cancellable
,
198 GAsyncReadyCallback callback
,
200 GFileEnumerator
* (* enumerate_children_finish
) (GFile
*file
,
204 GFileInfo
* (* query_info
) (GFile
*file
,
205 const char *attributes
,
206 GFileQueryInfoFlags flags
,
207 GCancellable
*cancellable
,
209 void (* query_info_async
) (GFile
*file
,
210 const char *attributes
,
211 GFileQueryInfoFlags flags
,
213 GCancellable
*cancellable
,
214 GAsyncReadyCallback callback
,
216 GFileInfo
* (* query_info_finish
) (GFile
*file
,
220 GFileInfo
* (* query_filesystem_info
) (GFile
*file
,
221 const char *attributes
,
222 GCancellable
*cancellable
,
224 void (* query_filesystem_info_async
) (GFile
*file
,
225 const char *attributes
,
227 GCancellable
*cancellable
,
228 GAsyncReadyCallback callback
,
230 GFileInfo
* (* query_filesystem_info_finish
)(GFile
*file
,
234 GMount
* (* find_enclosing_mount
) (GFile
*file
,
235 GCancellable
*cancellable
,
237 void (* find_enclosing_mount_async
) (GFile
*file
,
239 GCancellable
*cancellable
,
240 GAsyncReadyCallback callback
,
242 GMount
* (* find_enclosing_mount_finish
) (GFile
*file
,
246 GFile
* (* set_display_name
) (GFile
*file
,
247 const char *display_name
,
248 GCancellable
*cancellable
,
250 void (* set_display_name_async
) (GFile
*file
,
251 const char *display_name
,
253 GCancellable
*cancellable
,
254 GAsyncReadyCallback callback
,
256 GFile
* (* set_display_name_finish
) (GFile
*file
,
260 GFileAttributeInfoList
* (* query_settable_attributes
) (GFile
*file
,
261 GCancellable
*cancellable
,
263 void (* _query_settable_attributes_async
) (void);
264 void (* _query_settable_attributes_finish
) (void);
266 GFileAttributeInfoList
* (* query_writable_namespaces
) (GFile
*file
,
267 GCancellable
*cancellable
,
269 void (* _query_writable_namespaces_async
) (void);
270 void (* _query_writable_namespaces_finish
) (void);
272 gboolean (* set_attribute
) (GFile
*file
,
273 const char *attribute
,
274 GFileAttributeType type
,
276 GFileQueryInfoFlags flags
,
277 GCancellable
*cancellable
,
279 gboolean (* set_attributes_from_info
) (GFile
*file
,
281 GFileQueryInfoFlags flags
,
282 GCancellable
*cancellable
,
284 void (* set_attributes_async
) (GFile
*file
,
286 GFileQueryInfoFlags flags
,
288 GCancellable
*cancellable
,
289 GAsyncReadyCallback callback
,
291 gboolean (* set_attributes_finish
) (GFile
*file
,
292 GAsyncResult
*result
,
296 GFileInputStream
* (* read_fn
) (GFile
*file
,
297 GCancellable
*cancellable
,
299 void (* read_async
) (GFile
*file
,
301 GCancellable
*cancellable
,
302 GAsyncReadyCallback callback
,
304 GFileInputStream
* (* read_finish
) (GFile
*file
,
308 GFileOutputStream
* (* append_to
) (GFile
*file
,
309 GFileCreateFlags flags
,
310 GCancellable
*cancellable
,
312 void (* append_to_async
) (GFile
*file
,
313 GFileCreateFlags flags
,
315 GCancellable
*cancellable
,
316 GAsyncReadyCallback callback
,
318 GFileOutputStream
* (* append_to_finish
) (GFile
*file
,
322 GFileOutputStream
* (* create
) (GFile
*file
,
323 GFileCreateFlags flags
,
324 GCancellable
*cancellable
,
326 void (* create_async
) (GFile
*file
,
327 GFileCreateFlags flags
,
329 GCancellable
*cancellable
,
330 GAsyncReadyCallback callback
,
332 GFileOutputStream
* (* create_finish
) (GFile
*file
,
336 GFileOutputStream
* (* replace
) (GFile
*file
,
338 gboolean make_backup
,
339 GFileCreateFlags flags
,
340 GCancellable
*cancellable
,
342 void (* replace_async
) (GFile
*file
,
344 gboolean make_backup
,
345 GFileCreateFlags flags
,
347 GCancellable
*cancellable
,
348 GAsyncReadyCallback callback
,
350 GFileOutputStream
* (* replace_finish
) (GFile
*file
,
354 gboolean (* delete_file
) (GFile
*file
,
355 GCancellable
*cancellable
,
357 void (* delete_file_async
) (GFile
*file
,
359 GCancellable
*cancellable
,
360 GAsyncReadyCallback callback
,
362 gboolean (* delete_file_finish
) (GFile
*file
,
363 GAsyncResult
*result
,
366 gboolean (* trash
) (GFile
*file
,
367 GCancellable
*cancellable
,
369 void (* trash_async
) (GFile
*file
,
371 GCancellable
*cancellable
,
372 GAsyncReadyCallback callback
,
374 gboolean (* trash_finish
) (GFile
*file
,
375 GAsyncResult
*result
,
378 gboolean (* make_directory
) (GFile
*file
,
379 GCancellable
*cancellable
,
381 void (* make_directory_async
) (GFile
*file
,
383 GCancellable
*cancellable
,
384 GAsyncReadyCallback callback
,
386 gboolean (* make_directory_finish
) (GFile
*file
,
387 GAsyncResult
*result
,
390 gboolean (* make_symbolic_link
) (GFile
*file
,
391 const char *symlink_value
,
392 GCancellable
*cancellable
,
394 void (* _make_symbolic_link_async
) (void);
395 void (* _make_symbolic_link_finish
) (void);
397 gboolean (* copy
) (GFile
*source
,
399 GFileCopyFlags flags
,
400 GCancellable
*cancellable
,
401 GFileProgressCallback progress_callback
,
402 gpointer progress_callback_data
,
404 void (* copy_async
) (GFile
*source
,
406 GFileCopyFlags flags
,
408 GCancellable
*cancellable
,
409 GFileProgressCallback progress_callback
,
410 gpointer progress_callback_data
,
411 GAsyncReadyCallback callback
,
413 gboolean (* copy_finish
) (GFile
*file
,
417 gboolean (* move
) (GFile
*source
,
419 GFileCopyFlags flags
,
420 GCancellable
*cancellable
,
421 GFileProgressCallback progress_callback
,
422 gpointer progress_callback_data
,
424 void (* _move_async
) (void);
425 void (* _move_finish
) (void);
427 void (* mount_mountable
) (GFile
*file
,
428 GMountMountFlags flags
,
429 GMountOperation
*mount_operation
,
430 GCancellable
*cancellable
,
431 GAsyncReadyCallback callback
,
433 GFile
* (* mount_mountable_finish
) (GFile
*file
,
434 GAsyncResult
*result
,
437 void (* unmount_mountable
) (GFile
*file
,
438 GMountUnmountFlags flags
,
439 GCancellable
*cancellable
,
440 GAsyncReadyCallback callback
,
442 gboolean (* unmount_mountable_finish
) (GFile
*file
,
443 GAsyncResult
*result
,
446 void (* eject_mountable
) (GFile
*file
,
447 GMountUnmountFlags flags
,
448 GCancellable
*cancellable
,
449 GAsyncReadyCallback callback
,
451 gboolean (* eject_mountable_finish
) (GFile
*file
,
452 GAsyncResult
*result
,
455 void (* mount_enclosing_volume
) (GFile
*location
,
456 GMountMountFlags flags
,
457 GMountOperation
*mount_operation
,
458 GCancellable
*cancellable
,
459 GAsyncReadyCallback callback
,
461 gboolean (* mount_enclosing_volume_finish
) (GFile
*location
,
462 GAsyncResult
*result
,
465 GFileMonitor
* (* monitor_dir
) (GFile
*file
,
466 GFileMonitorFlags flags
,
467 GCancellable
*cancellable
,
469 GFileMonitor
* (* monitor_file
) (GFile
*file
,
470 GFileMonitorFlags flags
,
471 GCancellable
*cancellable
,
474 GFileIOStream
* (* open_readwrite
) (GFile
*file
,
475 GCancellable
*cancellable
,
477 void (* open_readwrite_async
) (GFile
*file
,
479 GCancellable
*cancellable
,
480 GAsyncReadyCallback callback
,
482 GFileIOStream
* (* open_readwrite_finish
) (GFile
*file
,
485 GFileIOStream
* (* create_readwrite
) (GFile
*file
,
486 GFileCreateFlags flags
,
487 GCancellable
*cancellable
,
489 void (* create_readwrite_async
) (GFile
*file
,
490 GFileCreateFlags flags
,
492 GCancellable
*cancellable
,
493 GAsyncReadyCallback callback
,
495 GFileIOStream
* (* create_readwrite_finish
) (GFile
*file
,
498 GFileIOStream
* (* replace_readwrite
) (GFile
*file
,
500 gboolean make_backup
,
501 GFileCreateFlags flags
,
502 GCancellable
*cancellable
,
504 void (* replace_readwrite_async
) (GFile
*file
,
506 gboolean make_backup
,
507 GFileCreateFlags flags
,
509 GCancellable
*cancellable
,
510 GAsyncReadyCallback callback
,
512 GFileIOStream
* (* replace_readwrite_finish
) (GFile
*file
,
516 void (* start_mountable
) (GFile
*file
,
517 GDriveStartFlags flags
,
518 GMountOperation
*start_operation
,
519 GCancellable
*cancellable
,
520 GAsyncReadyCallback callback
,
522 gboolean (* start_mountable_finish
) (GFile
*file
,
523 GAsyncResult
*result
,
526 void (* stop_mountable
) (GFile
*file
,
527 GMountUnmountFlags flags
,
528 GMountOperation
*mount_operation
,
529 GCancellable
*cancellable
,
530 GAsyncReadyCallback callback
,
532 gboolean (* stop_mountable_finish
) (GFile
*file
,
533 GAsyncResult
*result
,
536 gboolean supports_thread_contexts
;
538 void (* unmount_mountable_with_operation
) (GFile
*file
,
539 GMountUnmountFlags flags
,
540 GMountOperation
*mount_operation
,
541 GCancellable
*cancellable
,
542 GAsyncReadyCallback callback
,
544 gboolean (* unmount_mountable_with_operation_finish
) (GFile
*file
,
545 GAsyncResult
*result
,
548 void (* eject_mountable_with_operation
) (GFile
*file
,
549 GMountUnmountFlags flags
,
550 GMountOperation
*mount_operation
,
551 GCancellable
*cancellable
,
552 GAsyncReadyCallback callback
,
554 gboolean (* eject_mountable_with_operation_finish
) (GFile
*file
,
555 GAsyncResult
*result
,
558 void (* poll_mountable
) (GFile
*file
,
559 GCancellable
*cancellable
,
560 GAsyncReadyCallback callback
,
562 gboolean (* poll_mountable_finish
) (GFile
*file
,
563 GAsyncResult
*result
,
566 gboolean (* measure_disk_usage
) (GFile
*file
,
567 GFileMeasureFlags flags
,
568 GCancellable
*cancellable
,
569 GFileMeasureProgressCallback progress_callback
,
570 gpointer progress_data
,
575 void (* measure_disk_usage_async
) (GFile
*file
,
576 GFileMeasureFlags flags
,
578 GCancellable
*cancellable
,
579 GFileMeasureProgressCallback progress_callback
,
580 gpointer progress_data
,
581 GAsyncReadyCallback callback
,
583 gboolean (* measure_disk_usage_finish
) (GFile
*file
,
584 GAsyncResult
*result
,
591 GLIB_AVAILABLE_IN_ALL
592 GType
g_file_get_type (void) G_GNUC_CONST
;
594 GLIB_AVAILABLE_IN_ALL
595 GFile
* g_file_new_for_path (const char *path
);
596 GLIB_AVAILABLE_IN_ALL
597 GFile
* g_file_new_for_uri (const char *uri
);
598 GLIB_AVAILABLE_IN_ALL
599 GFile
* g_file_new_for_commandline_arg (const char *arg
);
600 GLIB_AVAILABLE_IN_2_36
601 GFile
* g_file_new_for_commandline_arg_and_cwd (const gchar
*arg
,
603 GLIB_AVAILABLE_IN_2_32
604 GFile
* g_file_new_tmp (const char *tmpl
,
605 GFileIOStream
**iostream
,
607 GLIB_AVAILABLE_IN_ALL
608 GFile
* g_file_parse_name (const char *parse_name
);
609 GLIB_AVAILABLE_IN_ALL
610 GFile
* g_file_dup (GFile
*file
);
611 GLIB_AVAILABLE_IN_ALL
612 guint
g_file_hash (gconstpointer file
);
613 GLIB_AVAILABLE_IN_ALL
614 gboolean
g_file_equal (GFile
*file1
,
616 GLIB_AVAILABLE_IN_ALL
617 char * g_file_get_basename (GFile
*file
);
618 GLIB_AVAILABLE_IN_ALL
619 char * g_file_get_path (GFile
*file
);
620 GLIB_AVAILABLE_IN_ALL
621 char * g_file_get_uri (GFile
*file
);
622 GLIB_AVAILABLE_IN_ALL
623 char * g_file_get_parse_name (GFile
*file
);
624 GLIB_AVAILABLE_IN_ALL
625 GFile
* g_file_get_parent (GFile
*file
);
626 GLIB_AVAILABLE_IN_ALL
627 gboolean
g_file_has_parent (GFile
*file
,
629 GLIB_AVAILABLE_IN_ALL
630 GFile
* g_file_get_child (GFile
*file
,
632 GLIB_AVAILABLE_IN_ALL
633 GFile
* g_file_get_child_for_display_name (GFile
*file
,
634 const char *display_name
,
636 GLIB_AVAILABLE_IN_ALL
637 gboolean
g_file_has_prefix (GFile
*file
,
639 GLIB_AVAILABLE_IN_ALL
640 char * g_file_get_relative_path (GFile
*parent
,
642 GLIB_AVAILABLE_IN_ALL
643 GFile
* g_file_resolve_relative_path (GFile
*file
,
644 const char *relative_path
);
645 GLIB_AVAILABLE_IN_ALL
646 gboolean
g_file_is_native (GFile
*file
);
647 GLIB_AVAILABLE_IN_ALL
648 gboolean
g_file_has_uri_scheme (GFile
*file
,
649 const char *uri_scheme
);
650 GLIB_AVAILABLE_IN_ALL
651 char * g_file_get_uri_scheme (GFile
*file
);
652 GLIB_AVAILABLE_IN_ALL
653 GFileInputStream
* g_file_read (GFile
*file
,
654 GCancellable
*cancellable
,
656 GLIB_AVAILABLE_IN_ALL
657 void g_file_read_async (GFile
*file
,
659 GCancellable
*cancellable
,
660 GAsyncReadyCallback callback
,
662 GLIB_AVAILABLE_IN_ALL
663 GFileInputStream
* g_file_read_finish (GFile
*file
,
666 GLIB_AVAILABLE_IN_ALL
667 GFileOutputStream
* g_file_append_to (GFile
*file
,
668 GFileCreateFlags flags
,
669 GCancellable
*cancellable
,
671 GLIB_AVAILABLE_IN_ALL
672 GFileOutputStream
* g_file_create (GFile
*file
,
673 GFileCreateFlags flags
,
674 GCancellable
*cancellable
,
676 GLIB_AVAILABLE_IN_ALL
677 GFileOutputStream
* g_file_replace (GFile
*file
,
679 gboolean make_backup
,
680 GFileCreateFlags flags
,
681 GCancellable
*cancellable
,
683 GLIB_AVAILABLE_IN_ALL
684 void g_file_append_to_async (GFile
*file
,
685 GFileCreateFlags flags
,
687 GCancellable
*cancellable
,
688 GAsyncReadyCallback callback
,
690 GLIB_AVAILABLE_IN_ALL
691 GFileOutputStream
* g_file_append_to_finish (GFile
*file
,
694 GLIB_AVAILABLE_IN_ALL
695 void g_file_create_async (GFile
*file
,
696 GFileCreateFlags flags
,
698 GCancellable
*cancellable
,
699 GAsyncReadyCallback callback
,
701 GLIB_AVAILABLE_IN_ALL
702 GFileOutputStream
* g_file_create_finish (GFile
*file
,
705 GLIB_AVAILABLE_IN_ALL
706 void g_file_replace_async (GFile
*file
,
708 gboolean make_backup
,
709 GFileCreateFlags flags
,
711 GCancellable
*cancellable
,
712 GAsyncReadyCallback callback
,
714 GLIB_AVAILABLE_IN_ALL
715 GFileOutputStream
* g_file_replace_finish (GFile
*file
,
718 GLIB_AVAILABLE_IN_ALL
719 GFileIOStream
* g_file_open_readwrite (GFile
*file
,
720 GCancellable
*cancellable
,
722 GLIB_AVAILABLE_IN_ALL
723 void g_file_open_readwrite_async (GFile
*file
,
725 GCancellable
*cancellable
,
726 GAsyncReadyCallback callback
,
728 GLIB_AVAILABLE_IN_ALL
729 GFileIOStream
* g_file_open_readwrite_finish (GFile
*file
,
732 GLIB_AVAILABLE_IN_ALL
733 GFileIOStream
* g_file_create_readwrite (GFile
*file
,
734 GFileCreateFlags flags
,
735 GCancellable
*cancellable
,
737 GLIB_AVAILABLE_IN_ALL
738 void g_file_create_readwrite_async (GFile
*file
,
739 GFileCreateFlags flags
,
741 GCancellable
*cancellable
,
742 GAsyncReadyCallback callback
,
744 GLIB_AVAILABLE_IN_ALL
745 GFileIOStream
* g_file_create_readwrite_finish (GFile
*file
,
748 GLIB_AVAILABLE_IN_ALL
749 GFileIOStream
* g_file_replace_readwrite (GFile
*file
,
751 gboolean make_backup
,
752 GFileCreateFlags flags
,
753 GCancellable
*cancellable
,
755 GLIB_AVAILABLE_IN_ALL
756 void g_file_replace_readwrite_async (GFile
*file
,
758 gboolean make_backup
,
759 GFileCreateFlags flags
,
761 GCancellable
*cancellable
,
762 GAsyncReadyCallback callback
,
764 GLIB_AVAILABLE_IN_ALL
765 GFileIOStream
* g_file_replace_readwrite_finish (GFile
*file
,
768 GLIB_AVAILABLE_IN_ALL
769 gboolean
g_file_query_exists (GFile
*file
,
770 GCancellable
*cancellable
);
771 GLIB_AVAILABLE_IN_ALL
772 GFileType
g_file_query_file_type (GFile
*file
,
773 GFileQueryInfoFlags flags
,
774 GCancellable
*cancellable
);
775 GLIB_AVAILABLE_IN_ALL
776 GFileInfo
* g_file_query_info (GFile
*file
,
777 const char *attributes
,
778 GFileQueryInfoFlags flags
,
779 GCancellable
*cancellable
,
781 GLIB_AVAILABLE_IN_ALL
782 void g_file_query_info_async (GFile
*file
,
783 const char *attributes
,
784 GFileQueryInfoFlags flags
,
786 GCancellable
*cancellable
,
787 GAsyncReadyCallback callback
,
789 GLIB_AVAILABLE_IN_ALL
790 GFileInfo
* g_file_query_info_finish (GFile
*file
,
793 GLIB_AVAILABLE_IN_ALL
794 GFileInfo
* g_file_query_filesystem_info (GFile
*file
,
795 const char *attributes
,
796 GCancellable
*cancellable
,
798 GLIB_AVAILABLE_IN_ALL
799 void g_file_query_filesystem_info_async (GFile
*file
,
800 const char *attributes
,
802 GCancellable
*cancellable
,
803 GAsyncReadyCallback callback
,
805 GLIB_AVAILABLE_IN_ALL
806 GFileInfo
* g_file_query_filesystem_info_finish (GFile
*file
,
809 GLIB_AVAILABLE_IN_ALL
810 GMount
* g_file_find_enclosing_mount (GFile
*file
,
811 GCancellable
*cancellable
,
813 GLIB_AVAILABLE_IN_ALL
814 void g_file_find_enclosing_mount_async (GFile
*file
,
816 GCancellable
*cancellable
,
817 GAsyncReadyCallback callback
,
819 GLIB_AVAILABLE_IN_ALL
820 GMount
* g_file_find_enclosing_mount_finish (GFile
*file
,
823 GLIB_AVAILABLE_IN_ALL
824 GFileEnumerator
* g_file_enumerate_children (GFile
*file
,
825 const char *attributes
,
826 GFileQueryInfoFlags flags
,
827 GCancellable
*cancellable
,
829 GLIB_AVAILABLE_IN_ALL
830 void g_file_enumerate_children_async (GFile
*file
,
831 const char *attributes
,
832 GFileQueryInfoFlags flags
,
834 GCancellable
*cancellable
,
835 GAsyncReadyCallback callback
,
837 GLIB_AVAILABLE_IN_ALL
838 GFileEnumerator
* g_file_enumerate_children_finish (GFile
*file
,
841 GLIB_AVAILABLE_IN_ALL
842 GFile
* g_file_set_display_name (GFile
*file
,
843 const char *display_name
,
844 GCancellable
*cancellable
,
846 GLIB_AVAILABLE_IN_ALL
847 void g_file_set_display_name_async (GFile
*file
,
848 const char *display_name
,
850 GCancellable
*cancellable
,
851 GAsyncReadyCallback callback
,
853 GLIB_AVAILABLE_IN_ALL
854 GFile
* g_file_set_display_name_finish (GFile
*file
,
857 GLIB_AVAILABLE_IN_ALL
858 gboolean
g_file_delete (GFile
*file
,
859 GCancellable
*cancellable
,
862 GLIB_AVAILABLE_IN_2_34
863 void g_file_delete_async (GFile
*file
,
865 GCancellable
*cancellable
,
866 GAsyncReadyCallback callback
,
869 GLIB_AVAILABLE_IN_2_34
870 gboolean
g_file_delete_finish (GFile
*file
,
871 GAsyncResult
*result
,
874 GLIB_AVAILABLE_IN_ALL
875 gboolean
g_file_trash (GFile
*file
,
876 GCancellable
*cancellable
,
879 GLIB_AVAILABLE_IN_2_38
880 void g_file_trash_async (GFile
*file
,
882 GCancellable
*cancellable
,
883 GAsyncReadyCallback callback
,
886 GLIB_AVAILABLE_IN_2_38
887 gboolean
g_file_trash_finish (GFile
*file
,
888 GAsyncResult
*result
,
891 GLIB_AVAILABLE_IN_ALL
892 gboolean
g_file_copy (GFile
*source
,
894 GFileCopyFlags flags
,
895 GCancellable
*cancellable
,
896 GFileProgressCallback progress_callback
,
897 gpointer progress_callback_data
,
899 GLIB_AVAILABLE_IN_ALL
900 void g_file_copy_async (GFile
*source
,
902 GFileCopyFlags flags
,
904 GCancellable
*cancellable
,
905 GFileProgressCallback progress_callback
,
906 gpointer progress_callback_data
,
907 GAsyncReadyCallback callback
,
909 GLIB_AVAILABLE_IN_ALL
910 gboolean
g_file_copy_finish (GFile
*file
,
913 GLIB_AVAILABLE_IN_ALL
914 gboolean
g_file_move (GFile
*source
,
916 GFileCopyFlags flags
,
917 GCancellable
*cancellable
,
918 GFileProgressCallback progress_callback
,
919 gpointer progress_callback_data
,
921 GLIB_AVAILABLE_IN_ALL
922 gboolean
g_file_make_directory (GFile
*file
,
923 GCancellable
*cancellable
,
925 GLIB_AVAILABLE_IN_2_38
926 void g_file_make_directory_async (GFile
*file
,
928 GCancellable
*cancellable
,
929 GAsyncReadyCallback callback
,
931 GLIB_AVAILABLE_IN_2_38
932 gboolean
g_file_make_directory_finish (GFile
*file
,
933 GAsyncResult
*result
,
936 GLIB_AVAILABLE_IN_ALL
937 gboolean
g_file_make_directory_with_parents (GFile
*file
,
938 GCancellable
*cancellable
,
940 GLIB_AVAILABLE_IN_ALL
941 gboolean
g_file_make_symbolic_link (GFile
*file
,
942 const char *symlink_value
,
943 GCancellable
*cancellable
,
945 GLIB_AVAILABLE_IN_ALL
946 GFileAttributeInfoList
*g_file_query_settable_attributes (GFile
*file
,
947 GCancellable
*cancellable
,
949 GLIB_AVAILABLE_IN_ALL
950 GFileAttributeInfoList
*g_file_query_writable_namespaces (GFile
*file
,
951 GCancellable
*cancellable
,
953 GLIB_AVAILABLE_IN_ALL
954 gboolean
g_file_set_attribute (GFile
*file
,
955 const char *attribute
,
956 GFileAttributeType type
,
958 GFileQueryInfoFlags flags
,
959 GCancellable
*cancellable
,
961 GLIB_AVAILABLE_IN_ALL
962 gboolean
g_file_set_attributes_from_info (GFile
*file
,
964 GFileQueryInfoFlags flags
,
965 GCancellable
*cancellable
,
967 GLIB_AVAILABLE_IN_ALL
968 void g_file_set_attributes_async (GFile
*file
,
970 GFileQueryInfoFlags flags
,
972 GCancellable
*cancellable
,
973 GAsyncReadyCallback callback
,
975 GLIB_AVAILABLE_IN_ALL
976 gboolean
g_file_set_attributes_finish (GFile
*file
,
977 GAsyncResult
*result
,
980 GLIB_AVAILABLE_IN_ALL
981 gboolean
g_file_set_attribute_string (GFile
*file
,
982 const char *attribute
,
984 GFileQueryInfoFlags flags
,
985 GCancellable
*cancellable
,
987 GLIB_AVAILABLE_IN_ALL
988 gboolean
g_file_set_attribute_byte_string (GFile
*file
,
989 const char *attribute
,
991 GFileQueryInfoFlags flags
,
992 GCancellable
*cancellable
,
994 GLIB_AVAILABLE_IN_ALL
995 gboolean
g_file_set_attribute_uint32 (GFile
*file
,
996 const char *attribute
,
998 GFileQueryInfoFlags flags
,
999 GCancellable
*cancellable
,
1001 GLIB_AVAILABLE_IN_ALL
1002 gboolean
g_file_set_attribute_int32 (GFile
*file
,
1003 const char *attribute
,
1005 GFileQueryInfoFlags flags
,
1006 GCancellable
*cancellable
,
1008 GLIB_AVAILABLE_IN_ALL
1009 gboolean
g_file_set_attribute_uint64 (GFile
*file
,
1010 const char *attribute
,
1012 GFileQueryInfoFlags flags
,
1013 GCancellable
*cancellable
,
1015 GLIB_AVAILABLE_IN_ALL
1016 gboolean
g_file_set_attribute_int64 (GFile
*file
,
1017 const char *attribute
,
1019 GFileQueryInfoFlags flags
,
1020 GCancellable
*cancellable
,
1022 GLIB_AVAILABLE_IN_ALL
1023 void g_file_mount_enclosing_volume (GFile
*location
,
1024 GMountMountFlags flags
,
1025 GMountOperation
*mount_operation
,
1026 GCancellable
*cancellable
,
1027 GAsyncReadyCallback callback
,
1028 gpointer user_data
);
1029 GLIB_AVAILABLE_IN_ALL
1030 gboolean
g_file_mount_enclosing_volume_finish (GFile
*location
,
1031 GAsyncResult
*result
,
1033 GLIB_AVAILABLE_IN_ALL
1034 void g_file_mount_mountable (GFile
*file
,
1035 GMountMountFlags flags
,
1036 GMountOperation
*mount_operation
,
1037 GCancellable
*cancellable
,
1038 GAsyncReadyCallback callback
,
1039 gpointer user_data
);
1040 GLIB_AVAILABLE_IN_ALL
1041 GFile
* g_file_mount_mountable_finish (GFile
*file
,
1042 GAsyncResult
*result
,
1044 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation
)
1045 void g_file_unmount_mountable (GFile
*file
,
1046 GMountUnmountFlags flags
,
1047 GCancellable
*cancellable
,
1048 GAsyncReadyCallback callback
,
1049 gpointer user_data
);
1051 GLIB_DEPRECATED_FOR(g_file_unmount_mountable_with_operation_finish
)
1052 gboolean
g_file_unmount_mountable_finish (GFile
*file
,
1053 GAsyncResult
*result
,
1055 GLIB_AVAILABLE_IN_ALL
1056 void g_file_unmount_mountable_with_operation (GFile
*file
,
1057 GMountUnmountFlags flags
,
1058 GMountOperation
*mount_operation
,
1059 GCancellable
*cancellable
,
1060 GAsyncReadyCallback callback
,
1061 gpointer user_data
);
1062 GLIB_AVAILABLE_IN_ALL
1063 gboolean
g_file_unmount_mountable_with_operation_finish (GFile
*file
,
1064 GAsyncResult
*result
,
1066 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation
)
1067 void g_file_eject_mountable (GFile
*file
,
1068 GMountUnmountFlags flags
,
1069 GCancellable
*cancellable
,
1070 GAsyncReadyCallback callback
,
1071 gpointer user_data
);
1073 GLIB_DEPRECATED_FOR(g_file_eject_mountable_with_operation_finish
)
1074 gboolean
g_file_eject_mountable_finish (GFile
*file
,
1075 GAsyncResult
*result
,
1077 GLIB_AVAILABLE_IN_ALL
1078 void g_file_eject_mountable_with_operation (GFile
*file
,
1079 GMountUnmountFlags flags
,
1080 GMountOperation
*mount_operation
,
1081 GCancellable
*cancellable
,
1082 GAsyncReadyCallback callback
,
1083 gpointer user_data
);
1084 GLIB_AVAILABLE_IN_ALL
1085 gboolean
g_file_eject_mountable_with_operation_finish (GFile
*file
,
1086 GAsyncResult
*result
,
1089 GLIB_AVAILABLE_IN_ALL
1090 gboolean
g_file_copy_attributes (GFile
*source
,
1092 GFileCopyFlags flags
,
1093 GCancellable
*cancellable
,
1097 GLIB_AVAILABLE_IN_ALL
1098 GFileMonitor
* g_file_monitor_directory (GFile
*file
,
1099 GFileMonitorFlags flags
,
1100 GCancellable
*cancellable
,
1102 GLIB_AVAILABLE_IN_ALL
1103 GFileMonitor
* g_file_monitor_file (GFile
*file
,
1104 GFileMonitorFlags flags
,
1105 GCancellable
*cancellable
,
1107 GLIB_AVAILABLE_IN_ALL
1108 GFileMonitor
* g_file_monitor (GFile
*file
,
1109 GFileMonitorFlags flags
,
1110 GCancellable
*cancellable
,
1113 GLIB_AVAILABLE_IN_2_38
1114 gboolean
g_file_measure_disk_usage (GFile
*file
,
1115 GFileMeasureFlags flags
,
1116 GCancellable
*cancellable
,
1117 GFileMeasureProgressCallback progress_callback
,
1118 gpointer progress_data
,
1119 guint64
*disk_usage
,
1124 GLIB_AVAILABLE_IN_2_38
1125 void g_file_measure_disk_usage_async (GFile
*file
,
1126 GFileMeasureFlags flags
,
1128 GCancellable
*cancellable
,
1129 GFileMeasureProgressCallback progress_callback
,
1130 gpointer progress_data
,
1131 GAsyncReadyCallback callback
,
1132 gpointer user_data
);
1134 GLIB_AVAILABLE_IN_2_38
1135 gboolean
g_file_measure_disk_usage_finish (GFile
*file
,
1136 GAsyncResult
*result
,
1137 guint64
*disk_usage
,
1142 GLIB_AVAILABLE_IN_ALL
1143 void g_file_start_mountable (GFile
*file
,
1144 GDriveStartFlags flags
,
1145 GMountOperation
*start_operation
,
1146 GCancellable
*cancellable
,
1147 GAsyncReadyCallback callback
,
1148 gpointer user_data
);
1149 GLIB_AVAILABLE_IN_ALL
1150 gboolean
g_file_start_mountable_finish (GFile
*file
,
1151 GAsyncResult
*result
,
1153 GLIB_AVAILABLE_IN_ALL
1154 void g_file_stop_mountable (GFile
*file
,
1155 GMountUnmountFlags flags
,
1156 GMountOperation
*mount_operation
,
1157 GCancellable
*cancellable
,
1158 GAsyncReadyCallback callback
,
1159 gpointer user_data
);
1160 GLIB_AVAILABLE_IN_ALL
1161 gboolean
g_file_stop_mountable_finish (GFile
*file
,
1162 GAsyncResult
*result
,
1165 GLIB_AVAILABLE_IN_ALL
1166 void g_file_poll_mountable (GFile
*file
,
1167 GCancellable
*cancellable
,
1168 GAsyncReadyCallback callback
,
1169 gpointer user_data
);
1170 GLIB_AVAILABLE_IN_ALL
1171 gboolean
g_file_poll_mountable_finish (GFile
*file
,
1172 GAsyncResult
*result
,
1177 GLIB_AVAILABLE_IN_ALL
1178 GAppInfo
*g_file_query_default_handler (GFile
*file
,
1179 GCancellable
*cancellable
,
1181 GLIB_AVAILABLE_IN_ALL
1182 gboolean
g_file_load_contents (GFile
*file
,
1183 GCancellable
*cancellable
,
1188 GLIB_AVAILABLE_IN_ALL
1189 void g_file_load_contents_async (GFile
*file
,
1190 GCancellable
*cancellable
,
1191 GAsyncReadyCallback callback
,
1192 gpointer user_data
);
1193 GLIB_AVAILABLE_IN_ALL
1194 gboolean
g_file_load_contents_finish (GFile
*file
,
1200 GLIB_AVAILABLE_IN_ALL
1201 void g_file_load_partial_contents_async (GFile
*file
,
1202 GCancellable
*cancellable
,
1203 GFileReadMoreCallback read_more_callback
,
1204 GAsyncReadyCallback callback
,
1205 gpointer user_data
);
1206 GLIB_AVAILABLE_IN_ALL
1207 gboolean
g_file_load_partial_contents_finish (GFile
*file
,
1213 GLIB_AVAILABLE_IN_ALL
1214 gboolean
g_file_replace_contents (GFile
*file
,
1215 const char *contents
,
1218 gboolean make_backup
,
1219 GFileCreateFlags flags
,
1221 GCancellable
*cancellable
,
1223 GLIB_AVAILABLE_IN_ALL
1224 void g_file_replace_contents_async (GFile
*file
,
1225 const char *contents
,
1228 gboolean make_backup
,
1229 GFileCreateFlags flags
,
1230 GCancellable
*cancellable
,
1231 GAsyncReadyCallback callback
,
1232 gpointer user_data
);
1233 GLIB_AVAILABLE_IN_2_40
1234 void g_file_replace_contents_bytes_async (GFile
*file
,
1237 gboolean make_backup
,
1238 GFileCreateFlags flags
,
1239 GCancellable
*cancellable
,
1240 GAsyncReadyCallback callback
,
1241 gpointer user_data
);
1242 GLIB_AVAILABLE_IN_ALL
1243 gboolean
g_file_replace_contents_finish (GFile
*file
,
1248 GLIB_AVAILABLE_IN_ALL
1249 gboolean
g_file_supports_thread_contexts (GFile
*file
);
1253 #endif /* __G_FILE_H__ */