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