source: appstream-generator/build/girepo/gio/FileIF.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 103.3 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.FileIF;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.AppInfo;
26private import gio.AppInfoIF;
27private import gio.AsyncResultIF;
28private import gio.Cancellable;
29private import gio.File;
30private import gio.FileAttributeInfoList;
31private import gio.FileEnumerator;
32private import gio.FileIF;
33private import gio.FileIOStream;
34private import gio.FileInfo;
35private import gio.FileInputStream;
36private import gio.FileMonitor;
37private import gio.FileOutputStream;
38private import gio.Mount;
39private import gio.MountIF;
40private import gio.MountOperation;
41private import glib.Bytes;
42private import glib.ConstructionException;
43private import glib.ErrorG;
44private import glib.GException;
45private import glib.Str;
46private import gobject.ObjectG;
47
48
49/**
50 * #GFile is a high level abstraction for manipulating files on a
51 * virtual file system. #GFiles are lightweight, immutable objects
52 * that do no I/O upon creation. It is necessary to understand that
53 * #GFile objects do not represent files, merely an identifier for a
54 * file. All file content I/O is implemented as streaming operations
55 * (see #GInputStream and #GOutputStream).
56 *
57 * To construct a #GFile, you can use:
58 * - g_file_new_for_path() if you have a path.
59 * - g_file_new_for_uri() if you have a URI.
60 * - g_file_new_for_commandline_arg() for a command line argument.
61 * - g_file_new_tmp() to create a temporary file from a template.
62 * - g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().
63 *
64 * One way to think of a #GFile is as an abstraction of a pathname. For
65 * normal files the system pathname is what is stored internally, but as
66 * #GFiles are extensible it could also be something else that corresponds
67 * to a pathname in a userspace implementation of a filesystem.
68 *
69 * #GFiles make up hierarchies of directories and files that correspond to
70 * the files on a filesystem. You can move through the file system with
71 * #GFile using g_file_get_parent() to get an identifier for the parent
72 * directory, g_file_get_child() to get a child within a directory,
73 * g_file_resolve_relative_path() to resolve a relative path between two
74 * #GFiles. There can be multiple hierarchies, so you may not end up at
75 * the same root if you repeatedly call g_file_get_parent() on two different
76 * files.
77 *
78 * All #GFiles have a basename (get with g_file_get_basename()). These names
79 * are byte strings that are used to identify the file on the filesystem
80 * (relative to its parent directory) and there is no guarantees that they
81 * have any particular charset encoding or even make any sense at all. If
82 * you want to use filenames in a user interface you should use the display
83 * name that you can get by requesting the
84 * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
85 * This is guaranteed to be in UTF-8 and can be used in a user interface.
86 * But always store the real basename or the #GFile to use to actually
87 * access the file, because there is no way to go from a display name to
88 * the actual name.
89 *
90 * Using #GFile as an identifier has the same weaknesses as using a path
91 * in that there may be multiple aliases for the same file. For instance,
92 * hard or soft links may cause two different #GFiles to refer to the same
93 * file. Other possible causes for aliases are: case insensitive filesystems,
94 * short and long names on FAT/NTFS, or bind mounts in Linux. If you want to
95 * check if two #GFiles point to the same file you can query for the
96 * %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
97 * canonicalization of pathnames passed in, so that trivial differences in
98 * the path string used at creation (duplicated slashes, slash at end of
99 * path, "." or ".." path segments, etc) does not create different #GFiles.
100 *
101 * Many #GFile operations have both synchronous and asynchronous versions
102 * to suit your application. Asynchronous versions of synchronous functions
103 * simply have _async() appended to their function names. The asynchronous
104 * I/O functions call a #GAsyncReadyCallback which is then used to finalize
105 * the operation, producing a GAsyncResult which is then passed to the
106 * function's matching _finish() operation.
107 *
108 * It is highly recommended to use asynchronous calls when running within a
109 * shared main loop, such as in the main thread of an application. This avoids
110 * I/O operations blocking other sources on the main loop from being dispatched.
111 * Synchronous I/O operations should be performed from worker threads. See the
112 * [introduction to asynchronous programming section][async-programming] for
113 * more.
114 *
115 * Some #GFile operations almost always take a noticeable amount of time, and
116 * so do not have synchronous analogs. Notable cases include:
117 * - g_file_mount_mountable() to mount a mountable file.
118 * - g_file_unmount_mountable_with_operation() to unmount a mountable file.
119 * - g_file_eject_mountable_with_operation() to eject a mountable file.
120 *
121 * ## Entity Tags # {#gfile-etag}
122 *
123 * One notable feature of #GFiles are entity tags, or "etags" for
124 * short. Entity tags are somewhat like a more abstract version of the
125 * traditional mtime, and can be used to quickly determine if the file
126 * has been modified from the version on the file system. See the
127 * HTTP 1.1
128 * [specification](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)
129 * for HTTP Etag headers, which are a very similar concept.
130 */
131public interface FileIF{
132        /** Get the main Gtk struct */
133        public GFile* getFileStruct();
134
135        /** the main Gtk struct as a void* */
136        protected void* getStruct();
137
138
139        /**
140         * Constructs a #GFile with the given @parse_name (i.e. something
141         * given by g_file_get_parse_name()). This operation never fails,
142         * but the returned object might not support any I/O operation if
143         * the @parse_name cannot be parsed.
144         *
145         * Params:
146         *     parseName = a file name or path to be parsed
147         *
148         * Returns: a new #GFile.
149         */
150        public static FileIF parseName(string parseName);
151
152        /**
153         * Gets an output stream for appending data to the file.
154         * If the file doesn't already exist it is created.
155         *
156         * By default files created are generally readable by everyone,
157         * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
158         * will be made readable only to the current user, to the level that
159         * is supported on the target filesystem.
160         *
161         * If @cancellable is not %NULL, then the operation can be cancelled
162         * by triggering the cancellable object from another thread. If the
163         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
164         * returned.
165         *
166         * Some file systems don't allow all file names, and may return an
167         * %G_IO_ERROR_INVALID_FILENAME error. If the file is a directory the
168         * %G_IO_ERROR_IS_DIRECTORY error will be returned. Other errors are
169         * possible too, and depend on what kind of filesystem the file is on.
170         *
171         * Params:
172         *     flags = a set of #GFileCreateFlags
173         *     cancellable = optional #GCancellable object,
174         *         %NULL to ignore
175         *
176         * Returns: a #GFileOutputStream, or %NULL on error.
177         *     Free the returned object with g_object_unref().
178         *
179         * Throws: GException on failure.
180         */
181        public FileOutputStream appendTo(GFileCreateFlags flags, Cancellable cancellable);
182
183        /**
184         * Asynchronously opens @file for appending.
185         *
186         * For more details, see g_file_append_to() which is
187         * the synchronous version of this call.
188         *
189         * When the operation is finished, @callback will be called.
190         * You can then call g_file_append_to_finish() to get the result
191         * of the operation.
192         *
193         * Params:
194         *     flags = a set of #GFileCreateFlags
195         *     ioPriority = the [I/O priority][io-priority] of the request
196         *     cancellable = optional #GCancellable object,
197         *         %NULL to ignore
198         *     callback = a #GAsyncReadyCallback to call
199         *         when the request is satisfied
200         *     userData = the data to pass to callback function
201         */
202        public void appendToAsync(GFileCreateFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
203
204        /**
205         * Finishes an asynchronous file append operation started with
206         * g_file_append_to_async().
207         *
208         * Params:
209         *     res = #GAsyncResult
210         *
211         * Returns: a valid #GFileOutputStream
212         *     or %NULL on error.
213         *     Free the returned object with g_object_unref().
214         *
215         * Throws: GException on failure.
216         */
217        public FileOutputStream appendToFinish(AsyncResultIF res);
218
219        /**
220         * Copies the file @source to the location specified by @destination.
221         * Can not handle recursive copies of directories.
222         *
223         * If the flag #G_FILE_COPY_OVERWRITE is specified an already
224         * existing @destination file is overwritten.
225         *
226         * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
227         * will be copied as symlinks, otherwise the target of the
228         * @source symlink will be copied.
229         *
230         * If @cancellable is not %NULL, then the operation can be cancelled by
231         * triggering the cancellable object from another thread. If the operation
232         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
233         *
234         * If @progress_callback is not %NULL, then the operation can be monitored
235         * by setting this to a #GFileProgressCallback function.
236         * @progress_callback_data will be passed to this function. It is guaranteed
237         * that this callback will be called after all data has been transferred with
238         * the total number of bytes copied during the operation.
239         *
240         * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
241         * is returned, independent on the status of the @destination.
242         *
243         * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
244         * the error %G_IO_ERROR_EXISTS is returned.
245         *
246         * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
247         * error is returned. If trying to overwrite a directory with a directory the
248         * %G_IO_ERROR_WOULD_MERGE error is returned.
249         *
250         * If the source is a directory and the target does not exist, or
251         * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
252         * %G_IO_ERROR_WOULD_RECURSE error is returned.
253         *
254         * If you are interested in copying the #GFile object itself (not the on-disk
255         * file), see g_file_dup().
256         *
257         * Params:
258         *     destination = destination #GFile
259         *     flags = set of #GFileCopyFlags
260         *     cancellable = optional #GCancellable object,
261         *         %NULL to ignore
262         *     progressCallback = function to callback with
263         *         progress information, or %NULL if progress information is not needed
264         *     progressCallbackData = user data to pass to @progress_callback
265         *
266         * Returns: %TRUE on success, %FALSE otherwise.
267         *
268         * Throws: GException on failure.
269         */
270        public bool copy(FileIF destination, GFileCopyFlags flags, Cancellable cancellable, GFileProgressCallback progressCallback, void* progressCallbackData);
271
272        /**
273         * Copies the file @source to the location specified by @destination
274         * asynchronously. For details of the behaviour, see g_file_copy().
275         *
276         * If @progress_callback is not %NULL, then that function that will be called
277         * just like in g_file_copy(). The callback will run in the default main context
278         * of the thread calling g_file_copy_async() — the same context as @callback is
279         * run in.
280         *
281         * When the operation is finished, @callback will be called. You can then call
282         * g_file_copy_finish() to get the result of the operation.
283         *
284         * Params:
285         *     destination = destination #GFile
286         *     flags = set of #GFileCopyFlags
287         *     ioPriority = the [I/O priority][io-priority] of the request
288         *     cancellable = optional #GCancellable object,
289         *         %NULL to ignore
290         *     progressCallback = function to callback with progress
291         *         information, or %NULL if progress information is not needed
292         *     progressCallbackData = user data to pass to @progress_callback
293         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
294         *     userData = the data to pass to callback function
295         */
296        public void copyAsync(FileIF destination, GFileCopyFlags flags, int ioPriority, Cancellable cancellable, GFileProgressCallback progressCallback, void* progressCallbackData, GAsyncReadyCallback callback, void* userData);
297
298        /**
299         * Copies the file attributes from @source to @destination.
300         *
301         * Normally only a subset of the file attributes are copied,
302         * those that are copies in a normal file copy operation
303         * (which for instance does not include e.g. owner). However
304         * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
305         * all the metadata that is possible to copy is copied. This
306         * is useful when implementing move by copy + delete source.
307         *
308         * Params:
309         *     destination = a #GFile to copy attributes to
310         *     flags = a set of #GFileCopyFlags
311         *     cancellable = optional #GCancellable object,
312         *         %NULL to ignore
313         *
314         * Returns: %TRUE if the attributes were copied successfully,
315         *     %FALSE otherwise.
316         *
317         * Throws: GException on failure.
318         */
319        public bool copyAttributes(FileIF destination, GFileCopyFlags flags, Cancellable cancellable);
320
321        /**
322         * Finishes copying the file started with g_file_copy_async().
323         *
324         * Params:
325         *     res = a #GAsyncResult
326         *
327         * Returns: a %TRUE on success, %FALSE on error.
328         *
329         * Throws: GException on failure.
330         */
331        public bool copyFinish(AsyncResultIF res);
332
333        /**
334         * Creates a new file and returns an output stream for writing to it.
335         * The file must not already exist.
336         *
337         * By default files created are generally readable by everyone,
338         * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
339         * will be made readable only to the current user, to the level
340         * that is supported on the target filesystem.
341         *
342         * If @cancellable is not %NULL, then the operation can be cancelled
343         * by triggering the cancellable object from another thread. If the
344         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
345         * returned.
346         *
347         * If a file or directory with this name already exists the
348         * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
349         * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
350         * error, and if the name is to long %G_IO_ERROR_FILENAME_TOO_LONG will
351         * be returned. Other errors are possible too, and depend on what kind
352         * of filesystem the file is on.
353         *
354         * Params:
355         *     flags = a set of #GFileCreateFlags
356         *     cancellable = optional #GCancellable object,
357         *         %NULL to ignore
358         *
359         * Returns: a #GFileOutputStream for the newly created
360         *     file, or %NULL on error.
361         *     Free the returned object with g_object_unref().
362         *
363         * Throws: GException on failure.
364         */
365        public FileOutputStream create(GFileCreateFlags flags, Cancellable cancellable);
366
367        /**
368         * Asynchronously creates a new file and returns an output stream
369         * for writing to it. The file must not already exist.
370         *
371         * For more details, see g_file_create() which is
372         * the synchronous version of this call.
373         *
374         * When the operation is finished, @callback will be called.
375         * You can then call g_file_create_finish() to get the result
376         * of the operation.
377         *
378         * Params:
379         *     flags = a set of #GFileCreateFlags
380         *     ioPriority = the [I/O priority][io-priority] of the request
381         *     cancellable = optional #GCancellable object,
382         *         %NULL to ignore
383         *     callback = a #GAsyncReadyCallback to call
384         *         when the request is satisfied
385         *     userData = the data to pass to callback function
386         */
387        public void createAsync(GFileCreateFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
388
389        /**
390         * Finishes an asynchronous file create operation started with
391         * g_file_create_async().
392         *
393         * Params:
394         *     res = a #GAsyncResult
395         *
396         * Returns: a #GFileOutputStream or %NULL on error.
397         *     Free the returned object with g_object_unref().
398         *
399         * Throws: GException on failure.
400         */
401        public FileOutputStream createFinish(AsyncResultIF res);
402
403        /**
404         * Creates a new file and returns a stream for reading and
405         * writing to it. The file must not already exist.
406         *
407         * By default files created are generally readable by everyone,
408         * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
409         * will be made readable only to the current user, to the level
410         * that is supported on the target filesystem.
411         *
412         * If @cancellable is not %NULL, then the operation can be cancelled
413         * by triggering the cancellable object from another thread. If the
414         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
415         * returned.
416         *
417         * If a file or directory with this name already exists, the
418         * %G_IO_ERROR_EXISTS error will be returned. Some file systems don't
419         * allow all file names, and may return an %G_IO_ERROR_INVALID_FILENAME
420         * error, and if the name is too long, %G_IO_ERROR_FILENAME_TOO_LONG
421         * will be returned. Other errors are possible too, and depend on what
422         * kind of filesystem the file is on.
423         *
424         * Note that in many non-local file cases read and write streams are
425         * not supported, so make sure you really need to do read and write
426         * streaming, rather than just opening for reading or writing.
427         *
428         * Params:
429         *     flags = a set of #GFileCreateFlags
430         *     cancellable = optional #GCancellable object,
431         *         %NULL to ignore
432         *
433         * Returns: a #GFileIOStream for the newly created
434         *     file, or %NULL on error.
435         *     Free the returned object with g_object_unref().
436         *
437         * Since: 2.22
438         *
439         * Throws: GException on failure.
440         */
441        public FileIOStream createReadwrite(GFileCreateFlags flags, Cancellable cancellable);
442
443        /**
444         * Asynchronously creates a new file and returns a stream
445         * for reading and writing to it. The file must not already exist.
446         *
447         * For more details, see g_file_create_readwrite() which is
448         * the synchronous version of this call.
449         *
450         * When the operation is finished, @callback will be called.
451         * You can then call g_file_create_readwrite_finish() to get
452         * the result of the operation.
453         *
454         * Params:
455         *     flags = a set of #GFileCreateFlags
456         *     ioPriority = the [I/O priority][io-priority] of the request
457         *     cancellable = optional #GCancellable object,
458         *         %NULL to ignore
459         *     callback = a #GAsyncReadyCallback to call
460         *         when the request is satisfied
461         *     userData = the data to pass to callback function
462         *
463         * Since: 2.22
464         */
465        public void createReadwriteAsync(GFileCreateFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
466
467        /**
468         * Finishes an asynchronous file create operation started with
469         * g_file_create_readwrite_async().
470         *
471         * Params:
472         *     res = a #GAsyncResult
473         *
474         * Returns: a #GFileIOStream or %NULL on error.
475         *     Free the returned object with g_object_unref().
476         *
477         * Since: 2.22
478         *
479         * Throws: GException on failure.
480         */
481        public FileIOStream createReadwriteFinish(AsyncResultIF res);
482
483        /**
484         * Deletes a file. If the @file is a directory, it will only be
485         * deleted if it is empty. This has the same semantics as g_unlink().
486         *
487         * If @cancellable is not %NULL, then the operation can be cancelled by
488         * triggering the cancellable object from another thread. If the operation
489         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
490         *
491         * Params:
492         *     cancellable = optional #GCancellable object,
493         *         %NULL to ignore
494         *
495         * Returns: %TRUE if the file was deleted. %FALSE otherwise.
496         *
497         * Throws: GException on failure.
498         */
499        public bool delet(Cancellable cancellable);
500
501        /**
502         * Asynchronously delete a file. If the @file is a directory, it will
503         * only be deleted if it is empty.  This has the same semantics as
504         * g_unlink().
505         *
506         * Params:
507         *     ioPriority = the [I/O priority][io-priority] of the request
508         *     cancellable = optional #GCancellable object,
509         *         %NULL to ignore
510         *     callback = a #GAsyncReadyCallback to call
511         *         when the request is satisfied
512         *     userData = the data to pass to callback function
513         *
514         * Since: 2.34
515         */
516        public void deleteAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
517
518        /**
519         * Finishes deleting a file started with g_file_delete_async().
520         *
521         * Params:
522         *     result = a #GAsyncResult
523         *
524         * Returns: %TRUE if the file was deleted. %FALSE otherwise.
525         *
526         * Since: 2.34
527         *
528         * Throws: GException on failure.
529         */
530        public bool deleteFinish(AsyncResultIF result);
531
532        /**
533         * Duplicates a #GFile handle. This operation does not duplicate
534         * the actual file or directory represented by the #GFile; see
535         * g_file_copy() if attempting to copy a file.
536         *
537         * This call does no blocking I/O.
538         *
539         * Returns: a new #GFile that is a duplicate
540         *     of the given #GFile.
541         */
542        public FileIF dup();
543
544        /**
545         * Starts an asynchronous eject on a mountable.
546         * When this operation has completed, @callback will be called with
547         * @user_user data, and the operation can be finalized with
548         * g_file_eject_mountable_finish().
549         *
550         * If @cancellable is not %NULL, then the operation can be cancelled by
551         * triggering the cancellable object from another thread. If the operation
552         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
553         *
554         * Deprecated: Use g_file_eject_mountable_with_operation() instead.
555         *
556         * Params:
557         *     flags = flags affecting the operation
558         *     cancellable = optional #GCancellable object,
559         *         %NULL to ignore
560         *     callback = a #GAsyncReadyCallback to call
561         *         when the request is satisfied, or %NULL
562         *     userData = the data to pass to callback function
563         */
564        public void ejectMountable(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
565
566        /**
567         * Finishes an asynchronous eject operation started by
568         * g_file_eject_mountable().
569         *
570         * Deprecated: Use g_file_eject_mountable_with_operation_finish()
571         * instead.
572         *
573         * Params:
574         *     result = a #GAsyncResult
575         *
576         * Returns: %TRUE if the @file was ejected successfully.
577         *     %FALSE otherwise.
578         *
579         * Throws: GException on failure.
580         */
581        public bool ejectMountableFinish(AsyncResultIF result);
582
583        /**
584         * Starts an asynchronous eject on a mountable.
585         * When this operation has completed, @callback will be called with
586         * @user_user data, and the operation can be finalized with
587         * g_file_eject_mountable_with_operation_finish().
588         *
589         * If @cancellable is not %NULL, then the operation can be cancelled by
590         * triggering the cancellable object from another thread. If the operation
591         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
592         *
593         * Params:
594         *     flags = flags affecting the operation
595         *     mountOperation = a #GMountOperation,
596         *         or %NULL to avoid user interaction
597         *     cancellable = optional #GCancellable object,
598         *         %NULL to ignore
599         *     callback = a #GAsyncReadyCallback to call
600         *         when the request is satisfied, or %NULL
601         *     userData = the data to pass to callback function
602         *
603         * Since: 2.22
604         */
605        public void ejectMountableWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
606
607        /**
608         * Finishes an asynchronous eject operation started by
609         * g_file_eject_mountable_with_operation().
610         *
611         * Params:
612         *     result = a #GAsyncResult
613         *
614         * Returns: %TRUE if the @file was ejected successfully.
615         *     %FALSE otherwise.
616         *
617         * Since: 2.22
618         *
619         * Throws: GException on failure.
620         */
621        public bool ejectMountableWithOperationFinish(AsyncResultIF result);
622
623        /**
624         * Gets the requested information about the files in a directory.
625         * The result is a #GFileEnumerator object that will give out
626         * #GFileInfo objects for all the files in the directory.
627         *
628         * The @attributes value is a string that specifies the file
629         * attributes that should be gathered. It is not an error if
630         * it's not possible to read a particular requested attribute
631         * from a file - it just won't be set. @attributes should
632         * be a comma-separated list of attributes or attribute wildcards.
633         * The wildcard "*" means all attributes, and a wildcard like
634         * "standard::*" means all attributes in the standard namespace.
635         * An example attribute query be "standard::*,owner::user".
636         * The standard attributes are available as defines, like
637         * #G_FILE_ATTRIBUTE_STANDARD_NAME.
638         *
639         * If @cancellable is not %NULL, then the operation can be cancelled
640         * by triggering the cancellable object from another thread. If the
641         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
642         * returned.
643         *
644         * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
645         * be returned. If the file is not a directory, the %G_IO_ERROR_NOT_DIRECTORY
646         * error will be returned. Other errors are possible too.
647         *
648         * Params:
649         *     attributes = an attribute query string
650         *     flags = a set of #GFileQueryInfoFlags
651         *     cancellable = optional #GCancellable object,
652         *         %NULL to ignore
653         *
654         * Returns: A #GFileEnumerator if successful,
655         *     %NULL on error. Free the returned object with g_object_unref().
656         *
657         * Throws: GException on failure.
658         */
659        public FileEnumerator enumerateChildren(string attributes, GFileQueryInfoFlags flags, Cancellable cancellable);
660
661        /**
662         * Asynchronously gets the requested information about the files
663         * in a directory. The result is a #GFileEnumerator object that will
664         * give out #GFileInfo objects for all the files in the directory.
665         *
666         * For more details, see g_file_enumerate_children() which is
667         * the synchronous version of this call.
668         *
669         * When the operation is finished, @callback will be called. You can
670         * then call g_file_enumerate_children_finish() to get the result of
671         * the operation.
672         *
673         * Params:
674         *     attributes = an attribute query string
675         *     flags = a set of #GFileQueryInfoFlags
676         *     ioPriority = the [I/O priority][io-priority] of the request
677         *     cancellable = optional #GCancellable object,
678         *         %NULL to ignore
679         *     callback = a #GAsyncReadyCallback to call when the
680         *         request is satisfied
681         *     userData = the data to pass to callback function
682         */
683        public void enumerateChildrenAsync(string attributes, GFileQueryInfoFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
684
685        /**
686         * Finishes an async enumerate children operation.
687         * See g_file_enumerate_children_async().
688         *
689         * Params:
690         *     res = a #GAsyncResult
691         *
692         * Returns: a #GFileEnumerator or %NULL
693         *     if an error occurred.
694         *     Free the returned object with g_object_unref().
695         *
696         * Throws: GException on failure.
697         */
698        public FileEnumerator enumerateChildrenFinish(AsyncResultIF res);
699
700        /**
701         * Checks if the two given #GFiles refer to the same file.
702         *
703         * Note that two #GFiles that differ can still refer to the same
704         * file on the filesystem due to various forms of filename
705         * aliasing.
706         *
707         * This call does no blocking I/O.
708         *
709         * Params:
710         *     file2 = the second #GFile
711         *
712         * Returns: %TRUE if @file1 and @file2 are equal.
713         */
714        public bool equal(FileIF file2);
715
716        /**
717         * Gets a #GMount for the #GFile.
718         *
719         * If the #GFileIface for @file does not have a mount (e.g.
720         * possibly a remote share), @error will be set to %G_IO_ERROR_NOT_FOUND
721         * and %NULL will be returned.
722         *
723         * If @cancellable is not %NULL, then the operation can be cancelled by
724         * triggering the cancellable object from another thread. If the operation
725         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
726         *
727         * Params:
728         *     cancellable = optional #GCancellable object,
729         *         %NULL to ignore
730         *
731         * Returns: a #GMount where the @file is located
732         *     or %NULL on error.
733         *     Free the returned object with g_object_unref().
734         *
735         * Throws: GException on failure.
736         */
737        public MountIF findEnclosingMount(Cancellable cancellable);
738
739        /**
740         * Asynchronously gets the mount for the file.
741         *
742         * For more details, see g_file_find_enclosing_mount() which is
743         * the synchronous version of this call.
744         *
745         * When the operation is finished, @callback will be called.
746         * You can then call g_file_find_enclosing_mount_finish() to
747         * get the result of the operation.
748         *
749         * Params:
750         *     ioPriority = the [I/O priority][io-priority] of the request
751         *     cancellable = optional #GCancellable object,
752         *         %NULL to ignore
753         *     callback = a #GAsyncReadyCallback to call
754         *         when the request is satisfied
755         *     userData = the data to pass to callback function
756         */
757        public void findEnclosingMountAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
758
759        /**
760         * Finishes an asynchronous find mount request.
761         * See g_file_find_enclosing_mount_async().
762         *
763         * Params:
764         *     res = a #GAsyncResult
765         *
766         * Returns: #GMount for given @file or %NULL on error.
767         *     Free the returned object with g_object_unref().
768         *
769         * Throws: GException on failure.
770         */
771        public MountIF findEnclosingMountFinish(AsyncResultIF res);
772
773        /**
774         * Gets the base name (the last component of the path) for a given #GFile.
775         *
776         * If called for the top level of a system (such as the filesystem root
777         * or a uri like sftp://host/) it will return a single directory separator
778         * (and on Windows, possibly a drive letter).
779         *
780         * The base name is a byte string (not UTF-8). It has no defined encoding
781         * or rules other than it may not contain zero bytes.  If you want to use
782         * filenames in a user interface you should use the display name that you
783         * can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
784         * attribute with g_file_query_info().
785         *
786         * This call does no blocking I/O.
787         *
788         * Returns: string containing the #GFile's base name, or
789         *     %NULL if given #GFile is invalid. The returned string should be
790         *     freed with g_free() when no longer needed.
791         */
792        public string getBasename();
793
794        /**
795         * Gets a child of @file with basename equal to @name.
796         *
797         * Note that the file with that specific name might not exist, but
798         * you can still have a #GFile that points to it. You can use this
799         * for instance to create that file.
800         *
801         * This call does no blocking I/O.
802         *
803         * Params:
804         *     name = string containing the child's basename
805         *
806         * Returns: a #GFile to a child specified by @name.
807         *     Free the returned object with g_object_unref().
808         */
809        public FileIF getChild(string name);
810
811        /**
812         * Gets the child of @file for a given @display_name (i.e. a UTF-8
813         * version of the name). If this function fails, it returns %NULL
814         * and @error will be set. This is very useful when constructing a
815         * #GFile for a new file and the user entered the filename in the
816         * user interface, for instance when you select a directory and
817         * type a filename in the file selector.
818         *
819         * This call does no blocking I/O.
820         *
821         * Params:
822         *     displayName = string to a possible child
823         *
824         * Returns: a #GFile to the specified child, or
825         *     %NULL if the display name couldn't be converted.
826         *     Free the returned object with g_object_unref().
827         *
828         * Throws: GException on failure.
829         */
830        public FileIF getChildForDisplayName(string displayName);
831
832        /**
833         * Gets the parent directory for the @file.
834         * If the @file represents the root directory of the
835         * file system, then %NULL will be returned.
836         *
837         * This call does no blocking I/O.
838         *
839         * Returns: a #GFile structure to the
840         *     parent of the given #GFile or %NULL if there is no parent. Free
841         *     the returned object with g_object_unref().
842         */
843        public FileIF getParent();
844
845        /**
846         * Gets the parse name of the @file.
847         * A parse name is a UTF-8 string that describes the
848         * file such that one can get the #GFile back using
849         * g_file_parse_name().
850         *
851         * This is generally used to show the #GFile as a nice
852         * full-pathname kind of string in a user interface,
853         * like in a location entry.
854         *
855         * For local files with names that can safely be converted
856         * to UTF-8 the pathname is used, otherwise the IRI is used
857         * (a form of URI that allows UTF-8 characters unescaped).
858         *
859         * This call does no blocking I/O.
860         *
861         * Returns: a string containing the #GFile's parse name.
862         *     The returned string should be freed with g_free()
863         *     when no longer needed.
864         */
865        public string getParseName();
866
867        /**
868         * Gets the local pathname for #GFile, if one exists. If non-%NULL, this is
869         * guaranteed to be an absolute, canonical path. It might contain symlinks.
870         *
871         * This call does no blocking I/O.
872         *
873         * Returns: string containing the #GFile's path, or %NULL
874         *     if no such path exists. The returned string should be freed
875         *     with g_free() when no longer needed.
876         */
877        public string getPath();
878
879        /**
880         * Gets the path for @descendant relative to @parent.
881         *
882         * This call does no blocking I/O.
883         *
884         * Params:
885         *     descendant = input #GFile
886         *
887         * Returns: string with the relative path from @descendant
888         *     to @parent, or %NULL if @descendant doesn't have @parent as
889         *     prefix. The returned string should be freed with g_free() when
890         *     no longer needed.
891         */
892        public string getRelativePath(FileIF descendant);
893
894        /**
895         * Gets the URI for the @file.
896         *
897         * This call does no blocking I/O.
898         *
899         * Returns: a string containing the #GFile's URI.
900         *     The returned string should be freed with g_free()
901         *     when no longer needed.
902         */
903        public string getUri();
904
905        /**
906         * Gets the URI scheme for a #GFile.
907         * RFC 3986 decodes the scheme as:
908         * |[
909         * URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
910         * ]|
911         * Common schemes include "file", "http", "ftp", etc.
912         *
913         * This call does no blocking I/O.
914         *
915         * Returns: a string containing the URI scheme for the given
916         *     #GFile. The returned string should be freed with g_free()
917         *     when no longer needed.
918         */
919        public string getUriScheme();
920
921        /**
922         * Checks if @file has a parent, and optionally, if it is @parent.
923         *
924         * If @parent is %NULL then this function returns %TRUE if @file has any
925         * parent at all.  If @parent is non-%NULL then %TRUE is only returned
926         * if @file is an immediate child of @parent.
927         *
928         * Params:
929         *     parent = the parent to check for, or %NULL
930         *
931         * Returns: %TRUE if @file is an immediate child of @parent (or any parent in
932         *     the case that @parent is %NULL).
933         *
934         * Since: 2.24
935         */
936        public bool hasParent(FileIF parent);
937
938        /**
939         * Checks whether @file has the prefix specified by @prefix.
940         *
941         * In other words, if the names of initial elements of @file's
942         * pathname match @prefix. Only full pathname elements are matched,
943         * so a path like /foo is not considered a prefix of /foobar, only
944         * of /foo/bar.
945         *
946         * A #GFile is not a prefix of itself. If you want to check for
947         * equality, use g_file_equal().
948         *
949         * This call does no I/O, as it works purely on names. As such it can
950         * sometimes return %FALSE even if @file is inside a @prefix (from a
951         * filesystem point of view), because the prefix of @file is an alias
952         * of @prefix.
953         *
954         * Params:
955         *     prefix = input #GFile
956         *
957         * Returns: %TRUE if the @files's parent, grandparent, etc is @prefix,
958         *     %FALSE otherwise.
959         */
960        public bool hasPrefix(FileIF prefix);
961
962        /**
963         * Checks to see if a #GFile has a given URI scheme.
964         *
965         * This call does no blocking I/O.
966         *
967         * Params:
968         *     uriScheme = a string containing a URI scheme
969         *
970         * Returns: %TRUE if #GFile's backend supports the
971         *     given URI scheme, %FALSE if URI scheme is %NULL,
972         *     not supported, or #GFile is invalid.
973         */
974        public bool hasUriScheme(string uriScheme);
975
976        /**
977         * Creates a hash value for a #GFile.
978         *
979         * This call does no blocking I/O.
980         *
981         * Returns: 0 if @file is not a valid #GFile, otherwise an
982         *     integer that can be used as hash value for the #GFile.
983         *     This function is intended for easily hashing a #GFile to
984         *     add to a #GHashTable or similar data structure.
985         */
986        public uint hash();
987
988        /**
989         * Checks to see if a file is native to the platform.
990         *
991         * A native file s one expressed in the platform-native filename format,
992         * e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
993         * as it might be on a locally mounted remote filesystem.
994         *
995         * On some systems non-native files may be available using the native
996         * filesystem via a userspace filesystem (FUSE), in these cases this call
997         * will return %FALSE, but g_file_get_path() will still return a native path.
998         *
999         * This call does no blocking I/O.
1000         *
1001         * Returns: %TRUE if @file is native
1002         */
1003        public bool isNative();
1004
1005        /**
1006         * Loads the content of the file into memory. The data is always
1007         * zero-terminated, but this is not included in the resultant @length.
1008         * The returned @content should be freed with g_free() when no longer
1009         * needed.
1010         *
1011         * If @cancellable is not %NULL, then the operation can be cancelled by
1012         * triggering the cancellable object from another thread. If the operation
1013         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1014         *
1015         * Params:
1016         *     cancellable = optional #GCancellable object, %NULL to ignore
1017         *     contents = a location to place the contents of the file
1018         *     length = a location to place the length of the contents of the file,
1019         *         or %NULL if the length is not needed
1020         *     etagOut = a location to place the current entity tag for the file,
1021         *         or %NULL if the entity tag is not needed
1022         *
1023         * Returns: %TRUE if the @file's contents were successfully loaded.
1024         *     %FALSE if there were errors.
1025         *
1026         * Throws: GException on failure.
1027         */
1028        public bool loadContents(Cancellable cancellable, out string contents, out string etagOut);
1029
1030        /**
1031         * Starts an asynchronous load of the @file's contents.
1032         *
1033         * For more details, see g_file_load_contents() which is
1034         * the synchronous version of this call.
1035         *
1036         * When the load operation has completed, @callback will be called
1037         * with @user data. To finish the operation, call
1038         * g_file_load_contents_finish() with the #GAsyncResult returned by
1039         * the @callback.
1040         *
1041         * If @cancellable is not %NULL, then the operation can be cancelled by
1042         * triggering the cancellable object from another thread. If the operation
1043         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1044         *
1045         * Params:
1046         *     cancellable = optional #GCancellable object, %NULL to ignore
1047         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
1048         *     userData = the data to pass to callback function
1049         */
1050        public void loadContentsAsync(Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1051
1052        /**
1053         * Finishes an asynchronous load of the @file's contents.
1054         * The contents are placed in @contents, and @length is set to the
1055         * size of the @contents string. The @content should be freed with
1056         * g_free() when no longer needed. If @etag_out is present, it will be
1057         * set to the new entity tag for the @file.
1058         *
1059         * Params:
1060         *     res = a #GAsyncResult
1061         *     contents = a location to place the contents of the file
1062         *     length = a location to place the length of the contents of the file,
1063         *         or %NULL if the length is not needed
1064         *     etagOut = a location to place the current entity tag for the file,
1065         *         or %NULL if the entity tag is not needed
1066         *
1067         * Returns: %TRUE if the load was successful. If %FALSE and @error is
1068         *     present, it will be set appropriately.
1069         *
1070         * Throws: GException on failure.
1071         */
1072        public bool loadContentsFinish(AsyncResultIF res, out string contents, out string etagOut);
1073
1074        /**
1075         * Reads the partial contents of a file. A #GFileReadMoreCallback should
1076         * be used to stop reading from the file when appropriate, else this
1077         * function will behave exactly as g_file_load_contents_async(). This
1078         * operation can be finished by g_file_load_partial_contents_finish().
1079         *
1080         * Users of this function should be aware that @user_data is passed to
1081         * both the @read_more_callback and the @callback.
1082         *
1083         * If @cancellable is not %NULL, then the operation can be cancelled by
1084         * triggering the cancellable object from another thread. If the operation
1085         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1086         *
1087         * Params:
1088         *     cancellable = optional #GCancellable object, %NULL to ignore
1089         *     readMoreCallback = a #GFileReadMoreCallback to receive partial data
1090         *         and to specify whether further data should be read
1091         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
1092         *     userData = the data to pass to the callback functions
1093         */
1094        public void loadPartialContentsAsync(Cancellable cancellable, GFileReadMoreCallback readMoreCallback, GAsyncReadyCallback callback, void* userData);
1095
1096        /**
1097         * Finishes an asynchronous partial load operation that was started
1098         * with g_file_load_partial_contents_async(). The data is always
1099         * zero-terminated, but this is not included in the resultant @length.
1100         * The returned @content should be freed with g_free() when no longer
1101         * needed.
1102         *
1103         * Params:
1104         *     res = a #GAsyncResult
1105         *     contents = a location to place the contents of the file
1106         *     length = a location to place the length of the contents of the file,
1107         *         or %NULL if the length is not needed
1108         *     etagOut = a location to place the current entity tag for the file,
1109         *         or %NULL if the entity tag is not needed
1110         *
1111         * Returns: %TRUE if the load was successful. If %FALSE and @error is
1112         *     present, it will be set appropriately.
1113         *
1114         * Throws: GException on failure.
1115         */
1116        public bool loadPartialContentsFinish(AsyncResultIF res, out string contents, out string etagOut);
1117
1118        /**
1119         * Creates a directory. Note that this will only create a child directory
1120         * of the immediate parent directory of the path or URI given by the #GFile.
1121         * To recursively create directories, see g_file_make_directory_with_parents().
1122         * This function will fail if the parent directory does not exist, setting
1123         * @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support
1124         * creating directories, this function will fail, setting @error to
1125         * %G_IO_ERROR_NOT_SUPPORTED.
1126         *
1127         * For a local #GFile the newly created directory will have the default
1128         * (current) ownership and permissions of the current process.
1129         *
1130         * If @cancellable is not %NULL, then the operation can be cancelled by
1131         * triggering the cancellable object from another thread. If the operation
1132         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1133         *
1134         * Params:
1135         *     cancellable = optional #GCancellable object,
1136         *         %NULL to ignore
1137         *
1138         * Returns: %TRUE on successful creation, %FALSE otherwise.
1139         *
1140         * Throws: GException on failure.
1141         */
1142        public bool makeDirectory(Cancellable cancellable);
1143
1144        /**
1145         * Asynchronously creates a directory.
1146         *
1147         * Params:
1148         *     ioPriority = the [I/O priority][io-priority] of the request
1149         *     cancellable = optional #GCancellable object,
1150         *         %NULL to ignore
1151         *     callback = a #GAsyncReadyCallback to call
1152         *         when the request is satisfied
1153         *     userData = the data to pass to callback function
1154         *
1155         * Since: 2.38
1156         */
1157        public void makeDirectoryAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1158
1159        /**
1160         * Finishes an asynchronous directory creation, started with
1161         * g_file_make_directory_async().
1162         *
1163         * Params:
1164         *     result = a #GAsyncResult
1165         *
1166         * Returns: %TRUE on successful directory creation, %FALSE otherwise.
1167         *
1168         * Since: 2.38
1169         *
1170         * Throws: GException on failure.
1171         */
1172        public bool makeDirectoryFinish(AsyncResultIF result);
1173
1174        /**
1175         * Creates a directory and any parent directories that may not
1176         * exist similar to 'mkdir -p'. If the file system does not support
1177         * creating directories, this function will fail, setting @error to
1178         * %G_IO_ERROR_NOT_SUPPORTED. If the directory itself already exists,
1179         * this function will fail setting @error to %G_IO_ERROR_EXISTS, unlike
1180         * the similar g_mkdir_with_parents().
1181         *
1182         * For a local #GFile the newly created directories will have the default
1183         * (current) ownership and permissions of the current process.
1184         *
1185         * If @cancellable is not %NULL, then the operation can be cancelled by
1186         * triggering the cancellable object from another thread. If the operation
1187         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1188         *
1189         * Params:
1190         *     cancellable = optional #GCancellable object,
1191         *         %NULL to ignore
1192         *
1193         * Returns: %TRUE if all directories have been successfully created, %FALSE
1194         *     otherwise.
1195         *
1196         * Since: 2.18
1197         *
1198         * Throws: GException on failure.
1199         */
1200        public bool makeDirectoryWithParents(Cancellable cancellable);
1201
1202        /**
1203         * Creates a symbolic link named @file which contains the string
1204         * @symlink_value.
1205         *
1206         * If @cancellable is not %NULL, then the operation can be cancelled by
1207         * triggering the cancellable object from another thread. If the operation
1208         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1209         *
1210         * Params:
1211         *     symlinkValue = a string with the path for the target of the new symlink
1212         *     cancellable = optional #GCancellable object,
1213         *         %NULL to ignore
1214         *
1215         * Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
1216         *
1217         * Throws: GException on failure.
1218         */
1219        public bool makeSymbolicLink(string symlinkValue, Cancellable cancellable);
1220
1221        /**
1222         * Recursively measures the disk usage of @file.
1223         *
1224         * This is essentially an analog of the 'du' command, but it also
1225         * reports the number of directories and non-directory files encountered
1226         * (including things like symbolic links).
1227         *
1228         * By default, errors are only reported against the toplevel file
1229         * itself.  Errors found while recursing are silently ignored, unless
1230         * %G_FILE_DISK_USAGE_REPORT_ALL_ERRORS is given in @flags.
1231         *
1232         * The returned size, @disk_usage, is in bytes and should be formatted
1233         * with g_format_size() in order to get something reasonable for showing
1234         * in a user interface.
1235         *
1236         * @progress_callback and @progress_data can be given to request
1237         * periodic progress updates while scanning.  See the documentation for
1238         * #GFileMeasureProgressCallback for information about when and how the
1239         * callback will be invoked.
1240         *
1241         * Params:
1242         *     flags = #GFileMeasureFlags
1243         *     cancellable = optional #GCancellable
1244         *     progressCallback = a #GFileMeasureProgressCallback
1245         *     progressData = user_data for @progress_callback
1246         *     diskUsage = the number of bytes of disk space used
1247         *     numDirs = the number of directories encountered
1248         *     numFiles = the number of non-directories encountered
1249         *
1250         * Returns: %TRUE if successful, with the out parameters set.
1251         *     %FALSE otherwise, with @error set.
1252         *
1253         * Since: 2.38
1254         *
1255         * Throws: GException on failure.
1256         */
1257        public bool measureDiskUsage(GFileMeasureFlags flags, Cancellable cancellable, GFileMeasureProgressCallback progressCallback, void* progressData, out ulong diskUsage, out ulong numDirs, out ulong numFiles);
1258
1259        /**
1260         * Recursively measures the disk usage of @file.
1261         *
1262         * This is the asynchronous version of g_file_measure_disk_usage().  See
1263         * there for more information.
1264         *
1265         * Params:
1266         *     flags = #GFileMeasureFlags
1267         *     ioPriority = the [I/O priority][io-priority] of the request
1268         *     cancellable = optional #GCancellable
1269         *     progressCallback = a #GFileMeasureProgressCallback
1270         *     progressData = user_data for @progress_callback
1271         *     callback = a #GAsyncReadyCallback to call when complete
1272         *     userData = the data to pass to callback function
1273         *
1274         * Since: 2.38
1275         */
1276        public void measureDiskUsageAsync(GFileMeasureFlags flags, int ioPriority, Cancellable cancellable, GFileMeasureProgressCallback progressCallback, void* progressData, GAsyncReadyCallback callback, void* userData);
1277
1278        /**
1279         * Collects the results from an earlier call to
1280         * g_file_measure_disk_usage_async().  See g_file_measure_disk_usage() for
1281         * more information.
1282         *
1283         * Params:
1284         *     result = the #GAsyncResult passed to your #GAsyncReadyCallback
1285         *     diskUsage = the number of bytes of disk space used
1286         *     numDirs = the number of directories encountered
1287         *     numFiles = the number of non-directories encountered
1288         *
1289         * Returns: %TRUE if successful, with the out parameters set.
1290         *     %FALSE otherwise, with @error set.
1291         *
1292         * Since: 2.38
1293         *
1294         * Throws: GException on failure.
1295         */
1296        public bool measureDiskUsageFinish(AsyncResultIF result, out ulong diskUsage, out ulong numDirs, out ulong numFiles);
1297
1298        /**
1299         * Obtains a file or directory monitor for the given file,
1300         * depending on the type of the file.
1301         *
1302         * If @cancellable is not %NULL, then the operation can be cancelled by
1303         * triggering the cancellable object from another thread. If the operation
1304         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1305         *
1306         * Params:
1307         *     flags = a set of #GFileMonitorFlags
1308         *     cancellable = optional #GCancellable object,
1309         *         %NULL to ignore
1310         *
1311         * Returns: a #GFileMonitor for the given @file,
1312         *     or %NULL on error.
1313         *     Free the returned object with g_object_unref().
1314         *
1315         * Since: 2.18
1316         *
1317         * Throws: GException on failure.
1318         */
1319        public FileMonitor monitor(GFileMonitorFlags flags, Cancellable cancellable);
1320
1321        /**
1322         * Obtains a directory monitor for the given file.
1323         * This may fail if directory monitoring is not supported.
1324         *
1325         * If @cancellable is not %NULL, then the operation can be cancelled by
1326         * triggering the cancellable object from another thread. If the operation
1327         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1328         *
1329         * It does not make sense for @flags to contain
1330         * %G_FILE_MONITOR_WATCH_HARD_LINKS, since hard links can not be made to
1331         * directories.  It is not possible to monitor all the files in a
1332         * directory for changes made via hard links; if you want to do this then
1333         * you must register individual watches with g_file_monitor().
1334         *
1335         * Params:
1336         *     flags = a set of #GFileMonitorFlags
1337         *     cancellable = optional #GCancellable object,
1338         *         %NULL to ignore
1339         *
1340         * Returns: a #GFileMonitor for the given @file,
1341         *     or %NULL on error.
1342         *     Free the returned object with g_object_unref().
1343         *
1344         * Throws: GException on failure.
1345         */
1346        public FileMonitor monitorDirectory(GFileMonitorFlags flags, Cancellable cancellable);
1347
1348        /**
1349         * Obtains a file monitor for the given file. If no file notification
1350         * mechanism exists, then regular polling of the file is used.
1351         *
1352         * If @cancellable is not %NULL, then the operation can be cancelled by
1353         * triggering the cancellable object from another thread. If the operation
1354         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1355         *
1356         * If @flags contains %G_FILE_MONITOR_WATCH_HARD_LINKS then the monitor
1357         * will also attempt to report changes made to the file via another
1358         * filename (ie, a hard link). Without this flag, you can only rely on
1359         * changes made through the filename contained in @file to be
1360         * reported. Using this flag may result in an increase in resource
1361         * usage, and may not have any effect depending on the #GFileMonitor
1362         * backend and/or filesystem type.
1363         *
1364         * Params:
1365         *     flags = a set of #GFileMonitorFlags
1366         *     cancellable = optional #GCancellable object,
1367         *         %NULL to ignore
1368         *
1369         * Returns: a #GFileMonitor for the given @file,
1370         *     or %NULL on error.
1371         *     Free the returned object with g_object_unref().
1372         *
1373         * Throws: GException on failure.
1374         */
1375        public FileMonitor monitorFile(GFileMonitorFlags flags, Cancellable cancellable);
1376
1377        /**
1378         * Starts a @mount_operation, mounting the volume that contains
1379         * the file @location.
1380         *
1381         * When this operation has completed, @callback will be called with
1382         * @user_user data, and the operation can be finalized with
1383         * g_file_mount_enclosing_volume_finish().
1384         *
1385         * If @cancellable is not %NULL, then the operation can be cancelled by
1386         * triggering the cancellable object from another thread. If the operation
1387         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1388         *
1389         * Params:
1390         *     flags = flags affecting the operation
1391         *     mountOperation = a #GMountOperation
1392         *         or %NULL to avoid user interaction
1393         *     cancellable = optional #GCancellable object,
1394         *         %NULL to ignore
1395         *     callback = a #GAsyncReadyCallback to call
1396         *         when the request is satisfied, or %NULL
1397         *     userData = the data to pass to callback function
1398         */
1399        public void mountEnclosingVolume(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1400
1401        /**
1402         * Finishes a mount operation started by g_file_mount_enclosing_volume().
1403         *
1404         * Params:
1405         *     result = a #GAsyncResult
1406         *
1407         * Returns: %TRUE if successful. If an error has occurred,
1408         *     this function will return %FALSE and set @error
1409         *     appropriately if present.
1410         *
1411         * Throws: GException on failure.
1412         */
1413        public bool mountEnclosingVolumeFinish(AsyncResultIF result);
1414
1415        /**
1416         * Mounts a file of type G_FILE_TYPE_MOUNTABLE.
1417         * Using @mount_operation, you can request callbacks when, for instance,
1418         * passwords are needed during authentication.
1419         *
1420         * If @cancellable is not %NULL, then the operation can be cancelled by
1421         * triggering the cancellable object from another thread. If the operation
1422         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1423         *
1424         * When the operation is finished, @callback will be called.
1425         * You can then call g_file_mount_mountable_finish() to get
1426         * the result of the operation.
1427         *
1428         * Params:
1429         *     flags = flags affecting the operation
1430         *     mountOperation = a #GMountOperation,
1431         *         or %NULL to avoid user interaction
1432         *     cancellable = optional #GCancellable object,
1433         *         %NULL to ignore
1434         *     callback = a #GAsyncReadyCallback to call
1435         *         when the request is satisfied, or %NULL
1436         *     userData = the data to pass to callback function
1437         */
1438        public void mountMountable(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1439
1440        /**
1441         * Finishes a mount operation. See g_file_mount_mountable() for details.
1442         *
1443         * Finish an asynchronous mount operation that was started
1444         * with g_file_mount_mountable().
1445         *
1446         * Params:
1447         *     result = a #GAsyncResult
1448         *
1449         * Returns: a #GFile or %NULL on error.
1450         *     Free the returned object with g_object_unref().
1451         *
1452         * Throws: GException on failure.
1453         */
1454        public FileIF mountMountableFinish(AsyncResultIF result);
1455
1456        /**
1457         * Tries to move the file or directory @source to the location specified
1458         * by @destination. If native move operations are supported then this is
1459         * used, otherwise a copy + delete fallback is used. The native
1460         * implementation may support moving directories (for instance on moves
1461         * inside the same filesystem), but the fallback code does not.
1462         *
1463         * If the flag #G_FILE_COPY_OVERWRITE is specified an already
1464         * existing @destination file is overwritten.
1465         *
1466         * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
1467         * will be copied as symlinks, otherwise the target of the
1468         * @source symlink will be copied.
1469         *
1470         * If @cancellable is not %NULL, then the operation can be cancelled by
1471         * triggering the cancellable object from another thread. If the operation
1472         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1473         *
1474         * If @progress_callback is not %NULL, then the operation can be monitored
1475         * by setting this to a #GFileProgressCallback function.
1476         * @progress_callback_data will be passed to this function. It is
1477         * guaranteed that this callback will be called after all data has been
1478         * transferred with the total number of bytes copied during the operation.
1479         *
1480         * If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
1481         * error is returned, independent on the status of the @destination.
1482         *
1483         * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
1484         * then the error %G_IO_ERROR_EXISTS is returned.
1485         *
1486         * If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
1487         * error is returned. If trying to overwrite a directory with a directory the
1488         * %G_IO_ERROR_WOULD_MERGE error is returned.
1489         *
1490         * If the source is a directory and the target does not exist, or
1491         * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
1492         * the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
1493         * move operation isn't available).
1494         *
1495         * Params:
1496         *     destination = #GFile pointing to the destination location
1497         *     flags = set of #GFileCopyFlags
1498         *     cancellable = optional #GCancellable object,
1499         *         %NULL to ignore
1500         *     progressCallback = #GFileProgressCallback
1501         *         function for updates
1502         *     progressCallbackData = gpointer to user data for
1503         *         the callback function
1504         *
1505         * Returns: %TRUE on successful move, %FALSE otherwise.
1506         *
1507         * Throws: GException on failure.
1508         */
1509        public bool move(FileIF destination, GFileCopyFlags flags, Cancellable cancellable, GFileProgressCallback progressCallback, void* progressCallbackData);
1510
1511        /**
1512         * Opens an existing file for reading and writing. The result is
1513         * a #GFileIOStream that can be used to read and write the contents
1514         * of the file.
1515         *
1516         * If @cancellable is not %NULL, then the operation can be cancelled
1517         * by triggering the cancellable object from another thread. If the
1518         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
1519         * returned.
1520         *
1521         * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
1522         * be returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
1523         * error will be returned. Other errors are possible too, and depend on
1524         * what kind of filesystem the file is on. Note that in many non-local
1525         * file cases read and write streams are not supported, so make sure you
1526         * really need to do read and write streaming, rather than just opening
1527         * for reading or writing.
1528         *
1529         * Params:
1530         *     cancellable = a #GCancellable
1531         *
1532         * Returns: #GFileIOStream or %NULL on error.
1533         *     Free the returned object with g_object_unref().
1534         *
1535         * Since: 2.22
1536         *
1537         * Throws: GException on failure.
1538         */
1539        public FileIOStream openReadwrite(Cancellable cancellable);
1540
1541        /**
1542         * Asynchronously opens @file for reading and writing.
1543         *
1544         * For more details, see g_file_open_readwrite() which is
1545         * the synchronous version of this call.
1546         *
1547         * When the operation is finished, @callback will be called.
1548         * You can then call g_file_open_readwrite_finish() to get
1549         * the result of the operation.
1550         *
1551         * Params:
1552         *     ioPriority = the [I/O priority][io-priority] of the request
1553         *     cancellable = optional #GCancellable object,
1554         *         %NULL to ignore
1555         *     callback = a #GAsyncReadyCallback to call
1556         *         when the request is satisfied
1557         *     userData = the data to pass to callback function
1558         *
1559         * Since: 2.22
1560         */
1561        public void openReadwriteAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1562
1563        /**
1564         * Finishes an asynchronous file read operation started with
1565         * g_file_open_readwrite_async().
1566         *
1567         * Params:
1568         *     res = a #GAsyncResult
1569         *
1570         * Returns: a #GFileIOStream or %NULL on error.
1571         *     Free the returned object with g_object_unref().
1572         *
1573         * Since: 2.22
1574         *
1575         * Throws: GException on failure.
1576         */
1577        public FileIOStream openReadwriteFinish(AsyncResultIF res);
1578
1579        /**
1580         * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
1581         *
1582         * If @cancellable is not %NULL, then the operation can be cancelled by
1583         * triggering the cancellable object from another thread. If the operation
1584         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1585         *
1586         * When the operation is finished, @callback will be called.
1587         * You can then call g_file_mount_mountable_finish() to get
1588         * the result of the operation.
1589         *
1590         * Params:
1591         *     cancellable = optional #GCancellable object, %NULL to ignore
1592         *     callback = a #GAsyncReadyCallback to call
1593         *         when the request is satisfied, or %NULL
1594         *     userData = the data to pass to callback function
1595         *
1596         * Since: 2.22
1597         */
1598        public void pollMountable(Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1599
1600        /**
1601         * Finishes a poll operation. See g_file_poll_mountable() for details.
1602         *
1603         * Finish an asynchronous poll operation that was polled
1604         * with g_file_poll_mountable().
1605         *
1606         * Params:
1607         *     result = a #GAsyncResult
1608         *
1609         * Returns: %TRUE if the operation finished successfully. %FALSE
1610         *     otherwise.
1611         *
1612         * Since: 2.22
1613         *
1614         * Throws: GException on failure.
1615         */
1616        public bool pollMountableFinish(AsyncResultIF result);
1617
1618        /**
1619         * Returns the #GAppInfo that is registered as the default
1620         * application to handle the file specified by @file.
1621         *
1622         * If @cancellable is not %NULL, then the operation can be cancelled by
1623         * triggering the cancellable object from another thread. If the operation
1624         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1625         *
1626         * Params:
1627         *     cancellable = optional #GCancellable object, %NULL to ignore
1628         *
1629         * Returns: a #GAppInfo if the handle was found,
1630         *     %NULL if there were errors.
1631         *     When you are done with it, release it with g_object_unref()
1632         *
1633         * Throws: GException on failure.
1634         */
1635        public AppInfoIF queryDefaultHandler(Cancellable cancellable);
1636
1637        /**
1638         * Utility function to check if a particular file exists. This is
1639         * implemented using g_file_query_info() and as such does blocking I/O.
1640         *
1641         * Note that in many cases it is racy to first check for file existence
1642         * and then execute something based on the outcome of that, because the
1643         * file might have been created or removed in between the operations. The
1644         * general approach to handling that is to not check, but just do the
1645         * operation and handle the errors as they come.
1646         *
1647         * As an example of race-free checking, take the case of reading a file,
1648         * and if it doesn't exist, creating it. There are two racy versions: read
1649         * it, and on error create it; and: check if it exists, if not create it.
1650         * These can both result in two processes creating the file (with perhaps
1651         * a partially written file as the result). The correct approach is to
1652         * always try to create the file with g_file_create() which will either
1653         * atomically create the file or fail with a %G_IO_ERROR_EXISTS error.
1654         *
1655         * However, in many cases an existence check is useful in a user interface,
1656         * for instance to make a menu item sensitive/insensitive, so that you don't
1657         * have to fool users that something is possible and then just show an error
1658         * dialog. If you do this, you should make sure to also handle the errors
1659         * that can happen due to races when you execute the operation.
1660         *
1661         * Params:
1662         *     cancellable = optional #GCancellable object,
1663         *         %NULL to ignore
1664         *
1665         * Returns: %TRUE if the file exists (and can be detected without error),
1666         *     %FALSE otherwise (or if cancelled).
1667         */
1668        public bool queryExists(Cancellable cancellable);
1669
1670        /**
1671         * Utility function to inspect the #GFileType of a file. This is
1672         * implemented using g_file_query_info() and as such does blocking I/O.
1673         *
1674         * The primary use case of this method is to check if a file is
1675         * a regular file, directory, or symlink.
1676         *
1677         * Params:
1678         *     flags = a set of #GFileQueryInfoFlags passed to g_file_query_info()
1679         *     cancellable = optional #GCancellable object,
1680         *         %NULL to ignore
1681         *
1682         * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN
1683         *     if the file does not exist
1684         *
1685         * Since: 2.18
1686         */
1687        public GFileType queryFileType(GFileQueryInfoFlags flags, Cancellable cancellable);
1688
1689        /**
1690         * Similar to g_file_query_info(), but obtains information
1691         * about the filesystem the @file is on, rather than the file itself.
1692         * For instance the amount of space available and the type of
1693         * the filesystem.
1694         *
1695         * The @attributes value is a string that specifies the attributes
1696         * that should be gathered. It is not an error if it's not possible
1697         * to read a particular requested attribute from a file - it just
1698         * won't be set. @attributes should be a comma-separated list of
1699         * attributes or attribute wildcards. The wildcard "*" means all
1700         * attributes, and a wildcard like "filesystem::*" means all attributes
1701         * in the filesystem namespace. The standard namespace for filesystem
1702         * attributes is "filesystem". Common attributes of interest are
1703         * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
1704         * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
1705         * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
1706         *
1707         * If @cancellable is not %NULL, then the operation can be cancelled
1708         * by triggering the cancellable object from another thread. If the
1709         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
1710         * returned.
1711         *
1712         * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will
1713         * be returned. Other errors are possible too, and depend on what
1714         * kind of filesystem the file is on.
1715         *
1716         * Params:
1717         *     attributes = an attribute query string
1718         *     cancellable = optional #GCancellable object,
1719         *         %NULL to ignore
1720         *
1721         * Returns: a #GFileInfo or %NULL if there was an error.
1722         *     Free the returned object with g_object_unref().
1723         *
1724         * Throws: GException on failure.
1725         */
1726        public FileInfo queryFilesystemInfo(string attributes, Cancellable cancellable);
1727
1728        /**
1729         * Asynchronously gets the requested information about the filesystem
1730         * that the specified @file is on. The result is a #GFileInfo object
1731         * that contains key-value attributes (such as type or size for the
1732         * file).
1733         *
1734         * For more details, see g_file_query_filesystem_info() which is the
1735         * synchronous version of this call.
1736         *
1737         * When the operation is finished, @callback will be called. You can
1738         * then call g_file_query_info_finish() to get the result of the
1739         * operation.
1740         *
1741         * Params:
1742         *     attributes = an attribute query string
1743         *     ioPriority = the [I/O priority][io-priority] of the request
1744         *     cancellable = optional #GCancellable object,
1745         *         %NULL to ignore
1746         *     callback = a #GAsyncReadyCallback to call
1747         *         when the request is satisfied
1748         *     userData = the data to pass to callback function
1749         */
1750        public void queryFilesystemInfoAsync(string attributes, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1751
1752        /**
1753         * Finishes an asynchronous filesystem info query.
1754         * See g_file_query_filesystem_info_async().
1755         *
1756         * Params:
1757         *     res = a #GAsyncResult
1758         *
1759         * Returns: #GFileInfo for given @file
1760         *     or %NULL on error.
1761         *     Free the returned object with g_object_unref().
1762         *
1763         * Throws: GException on failure.
1764         */
1765        public FileInfo queryFilesystemInfoFinish(AsyncResultIF res);
1766
1767        /**
1768         * Gets the requested information about specified @file.
1769         * The result is a #GFileInfo object that contains key-value
1770         * attributes (such as the type or size of the file).
1771         *
1772         * The @attributes value is a string that specifies the file
1773         * attributes that should be gathered. It is not an error if
1774         * it's not possible to read a particular requested attribute
1775         * from a file - it just won't be set. @attributes should be a
1776         * comma-separated list of attributes or attribute wildcards.
1777         * The wildcard "*" means all attributes, and a wildcard like
1778         * "standard::*" means all attributes in the standard namespace.
1779         * An example attribute query be "standard::*,owner::user".
1780         * The standard attributes are available as defines, like
1781         * #G_FILE_ATTRIBUTE_STANDARD_NAME.
1782         *
1783         * If @cancellable is not %NULL, then the operation can be cancelled
1784         * by triggering the cancellable object from another thread. If the
1785         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
1786         * returned.
1787         *
1788         * For symlinks, normally the information about the target of the
1789         * symlink is returned, rather than information about the symlink
1790         * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
1791         * in @flags the information about the symlink itself will be returned.
1792         * Also, for symlinks that point to non-existing files the information
1793         * about the symlink itself will be returned.
1794         *
1795         * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
1796         * returned. Other errors are possible too, and depend on what kind of
1797         * filesystem the file is on.
1798         *
1799         * Params:
1800         *     attributes = an attribute query string
1801         *     flags = a set of #GFileQueryInfoFlags
1802         *     cancellable = optional #GCancellable object,
1803         *         %NULL to ignore
1804         *
1805         * Returns: a #GFileInfo for the given @file, or %NULL
1806         *     on error. Free the returned object with g_object_unref().
1807         *
1808         * Throws: GException on failure.
1809         */
1810        public FileInfo queryInfo(string attributes, GFileQueryInfoFlags flags, Cancellable cancellable);
1811
1812        /**
1813         * Asynchronously gets the requested information about specified @file.
1814         * The result is a #GFileInfo object that contains key-value attributes
1815         * (such as type or size for the file).
1816         *
1817         * For more details, see g_file_query_info() which is the synchronous
1818         * version of this call.
1819         *
1820         * When the operation is finished, @callback will be called. You can
1821         * then call g_file_query_info_finish() to get the result of the operation.
1822         *
1823         * Params:
1824         *     attributes = an attribute query string
1825         *     flags = a set of #GFileQueryInfoFlags
1826         *     ioPriority = the [I/O priority][io-priority] of the request
1827         *     cancellable = optional #GCancellable object,
1828         *         %NULL to ignore
1829         *     callback = a #GAsyncReadyCallback to call when the
1830         *         request is satisfied
1831         *     userData = the data to pass to callback function
1832         */
1833        public void queryInfoAsync(string attributes, GFileQueryInfoFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1834
1835        /**
1836         * Finishes an asynchronous file info query.
1837         * See g_file_query_info_async().
1838         *
1839         * Params:
1840         *     res = a #GAsyncResult
1841         *
1842         * Returns: #GFileInfo for given @file
1843         *     or %NULL on error. Free the returned object with
1844         *     g_object_unref().
1845         *
1846         * Throws: GException on failure.
1847         */
1848        public FileInfo queryInfoFinish(AsyncResultIF res);
1849
1850        /**
1851         * Obtain the list of settable attributes for the file.
1852         *
1853         * Returns the type and full attribute name of all the attributes
1854         * that can be set on this file. This doesn't mean setting it will
1855         * always succeed though, you might get an access failure, or some
1856         * specific file may not support a specific attribute.
1857         *
1858         * If @cancellable is not %NULL, then the operation can be cancelled by
1859         * triggering the cancellable object from another thread. If the operation
1860         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1861         *
1862         * Params:
1863         *     cancellable = optional #GCancellable object,
1864         *         %NULL to ignore
1865         *
1866         * Returns: a #GFileAttributeInfoList describing the settable attributes.
1867         *     When you are done with it, release it with
1868         *     g_file_attribute_info_list_unref()
1869         *
1870         * Throws: GException on failure.
1871         */
1872        public FileAttributeInfoList querySettableAttributes(Cancellable cancellable);
1873
1874        /**
1875         * Obtain the list of attribute namespaces where new attributes
1876         * can be created by a user. An example of this is extended
1877         * attributes (in the "xattr" namespace).
1878         *
1879         * If @cancellable is not %NULL, then the operation can be cancelled by
1880         * triggering the cancellable object from another thread. If the operation
1881         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1882         *
1883         * Params:
1884         *     cancellable = optional #GCancellable object,
1885         *         %NULL to ignore
1886         *
1887         * Returns: a #GFileAttributeInfoList describing the writable namespaces.
1888         *     When you are done with it, release it with
1889         *     g_file_attribute_info_list_unref()
1890         *
1891         * Throws: GException on failure.
1892         */
1893        public FileAttributeInfoList queryWritableNamespaces(Cancellable cancellable);
1894
1895        /**
1896         * Opens a file for reading. The result is a #GFileInputStream that
1897         * can be used to read the contents of the file.
1898         *
1899         * If @cancellable is not %NULL, then the operation can be cancelled by
1900         * triggering the cancellable object from another thread. If the operation
1901         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
1902         *
1903         * If the file does not exist, the %G_IO_ERROR_NOT_FOUND error will be
1904         * returned. If the file is a directory, the %G_IO_ERROR_IS_DIRECTORY
1905         * error will be returned. Other errors are possible too, and depend
1906         * on what kind of filesystem the file is on.
1907         *
1908         * Params:
1909         *     cancellable = a #GCancellable
1910         *
1911         * Returns: #GFileInputStream or %NULL on error.
1912         *     Free the returned object with g_object_unref().
1913         *
1914         * Throws: GException on failure.
1915         */
1916        public FileInputStream read(Cancellable cancellable);
1917
1918        /**
1919         * Asynchronously opens @file for reading.
1920         *
1921         * For more details, see g_file_read() which is
1922         * the synchronous version of this call.
1923         *
1924         * When the operation is finished, @callback will be called.
1925         * You can then call g_file_read_finish() to get the result
1926         * of the operation.
1927         *
1928         * Params:
1929         *     ioPriority = the [I/O priority][io-priority] of the request
1930         *     cancellable = optional #GCancellable object,
1931         *         %NULL to ignore
1932         *     callback = a #GAsyncReadyCallback to call
1933         *         when the request is satisfied
1934         *     userData = the data to pass to callback function
1935         */
1936        public void readAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
1937
1938        /**
1939         * Finishes an asynchronous file read operation started with
1940         * g_file_read_async().
1941         *
1942         * Params:
1943         *     res = a #GAsyncResult
1944         *
1945         * Returns: a #GFileInputStream or %NULL on error.
1946         *     Free the returned object with g_object_unref().
1947         *
1948         * Throws: GException on failure.
1949         */
1950        public FileInputStream readFinish(AsyncResultIF res);
1951
1952        /**
1953         * Returns an output stream for overwriting the file, possibly
1954         * creating a backup copy of the file first. If the file doesn't exist,
1955         * it will be created.
1956         *
1957         * This will try to replace the file in the safest way possible so
1958         * that any errors during the writing will not affect an already
1959         * existing copy of the file. For instance, for local files it
1960         * may write to a temporary file and then atomically rename over
1961         * the destination when the stream is closed.
1962         *
1963         * By default files created are generally readable by everyone,
1964         * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
1965         * will be made readable only to the current user, to the level that
1966         * is supported on the target filesystem.
1967         *
1968         * If @cancellable is not %NULL, then the operation can be cancelled
1969         * by triggering the cancellable object from another thread. If the
1970         * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be
1971         * returned.
1972         *
1973         * If you pass in a non-%NULL @etag value and @file already exists, then
1974         * this value is compared to the current entity tag of the file, and if
1975         * they differ an %G_IO_ERROR_WRONG_ETAG error is returned. This
1976         * generally means that the file has been changed since you last read
1977         * it. You can get the new etag from g_file_output_stream_get_etag()
1978         * after you've finished writing and closed the #GFileOutputStream. When
1979         * you load a new file you can use g_file_input_stream_query_info() to
1980         * get the etag of the file.
1981         *
1982         * If @make_backup is %TRUE, this function will attempt to make a
1983         * backup of the current file before overwriting it. If this fails
1984         * a %G_IO_ERROR_CANT_CREATE_BACKUP error will be returned. If you
1985         * want to replace anyway, try again with @make_backup set to %FALSE.
1986         *
1987         * If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will
1988         * be returned, and if the file is some other form of non-regular file
1989         * then a %G_IO_ERROR_NOT_REGULAR_FILE error will be returned. Some
1990         * file systems don't allow all file names, and may return an
1991         * %G_IO_ERROR_INVALID_FILENAME error, and if the name is to long
1992         * %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors are
1993         * possible too, and depend on what kind of filesystem the file is on.
1994         *
1995         * Params:
1996         *     etag = an optional [entity tag][gfile-etag]
1997         *         for the current #GFile, or #NULL to ignore
1998         *     makeBackup = %TRUE if a backup should be created
1999         *     flags = a set of #GFileCreateFlags
2000         *     cancellable = optional #GCancellable object,
2001         *         %NULL to ignore
2002         *
2003         * Returns: a #GFileOutputStream or %NULL on error.
2004         *     Free the returned object with g_object_unref().
2005         *
2006         * Throws: GException on failure.
2007         */
2008        public FileOutputStream replace(string etag, bool makeBackup, GFileCreateFlags flags, Cancellable cancellable);
2009
2010        /**
2011         * Asynchronously overwrites the file, replacing the contents,
2012         * possibly creating a backup copy of the file first.
2013         *
2014         * For more details, see g_file_replace() which is
2015         * the synchronous version of this call.
2016         *
2017         * When the operation is finished, @callback will be called.
2018         * You can then call g_file_replace_finish() to get the result
2019         * of the operation.
2020         *
2021         * Params:
2022         *     etag = an [entity tag][gfile-etag] for the current #GFile,
2023         *         or %NULL to ignore
2024         *     makeBackup = %TRUE if a backup should be created
2025         *     flags = a set of #GFileCreateFlags
2026         *     ioPriority = the [I/O priority][io-priority] of the request
2027         *     cancellable = optional #GCancellable object,
2028         *         %NULL to ignore
2029         *     callback = a #GAsyncReadyCallback to call
2030         *         when the request is satisfied
2031         *     userData = the data to pass to callback function
2032         */
2033        public void replaceAsync(string etag, bool makeBackup, GFileCreateFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2034
2035        /**
2036         * Replaces the contents of @file with @contents of @length bytes.
2037         *
2038         * If @etag is specified (not %NULL), any existing file must have that etag,
2039         * or the error %G_IO_ERROR_WRONG_ETAG will be returned.
2040         *
2041         * If @make_backup is %TRUE, this function will attempt to make a backup
2042         * of @file. Internally, it uses g_file_replace(), so will try to replace the
2043         * file contents in the safest way possible. For example, atomic renames are
2044         * used when replacing local files’ contents.
2045         *
2046         * If @cancellable is not %NULL, then the operation can be cancelled by
2047         * triggering the cancellable object from another thread. If the operation
2048         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2049         *
2050         * The returned @new_etag can be used to verify that the file hasn't
2051         * changed the next time it is saved over.
2052         *
2053         * Params:
2054         *     contents = a string containing the new contents for @file
2055         *     length = the length of @contents in bytes
2056         *     etag = the old [entity-tag][gfile-etag] for the document,
2057         *         or %NULL
2058         *     makeBackup = %TRUE if a backup should be created
2059         *     flags = a set of #GFileCreateFlags
2060         *     newEtag = a location to a new [entity tag][gfile-etag]
2061         *         for the document. This should be freed with g_free() when no longer
2062         *         needed, or %NULL
2063         *     cancellable = optional #GCancellable object, %NULL to ignore
2064         *
2065         * Returns: %TRUE if successful. If an error has occurred, this function
2066         *     will return %FALSE and set @error appropriately if present.
2067         *
2068         * Throws: GException on failure.
2069         */
2070        public bool replaceContents(string contents, string etag, bool makeBackup, GFileCreateFlags flags, out string newEtag, Cancellable cancellable);
2071
2072        /**
2073         * Starts an asynchronous replacement of @file with the given
2074         * @contents of @length bytes. @etag will replace the document's
2075         * current entity tag.
2076         *
2077         * When this operation has completed, @callback will be called with
2078         * @user_user data, and the operation can be finalized with
2079         * g_file_replace_contents_finish().
2080         *
2081         * If @cancellable is not %NULL, then the operation can be cancelled by
2082         * triggering the cancellable object from another thread. If the operation
2083         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2084         *
2085         * If @make_backup is %TRUE, this function will attempt to
2086         * make a backup of @file.
2087         *
2088         * Note that no copy of @content will be made, so it must stay valid
2089         * until @callback is called. See g_file_replace_contents_bytes_async()
2090         * for a #GBytes version that will automatically hold a reference to the
2091         * contents (without copying) for the duration of the call.
2092         *
2093         * Params:
2094         *     contents = string of contents to replace the file with
2095         *     length = the length of @contents in bytes
2096         *     etag = a new [entity tag][gfile-etag] for the @file, or %NULL
2097         *     makeBackup = %TRUE if a backup should be created
2098         *     flags = a set of #GFileCreateFlags
2099         *     cancellable = optional #GCancellable object, %NULL to ignore
2100         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
2101         *     userData = the data to pass to callback function
2102         */
2103        public void replaceContentsAsync(string contents, string etag, bool makeBackup, GFileCreateFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2104
2105        /**
2106         * Same as g_file_replace_contents_async() but takes a #GBytes input instead.
2107         * This function will keep a ref on @contents until the operation is done.
2108         * Unlike g_file_replace_contents_async() this allows forgetting about the
2109         * content without waiting for the callback.
2110         *
2111         * When this operation has completed, @callback will be called with
2112         * @user_user data, and the operation can be finalized with
2113         * g_file_replace_contents_finish().
2114         *
2115         * Params:
2116         *     contents = a #GBytes
2117         *     etag = a new [entity tag][gfile-etag] for the @file, or %NULL
2118         *     makeBackup = %TRUE if a backup should be created
2119         *     flags = a set of #GFileCreateFlags
2120         *     cancellable = optional #GCancellable object, %NULL to ignore
2121         *     callback = a #GAsyncReadyCallback to call when the request is satisfied
2122         *     userData = the data to pass to callback function
2123         *
2124         * Since: 2.40
2125         */
2126        public void replaceContentsBytesAsync(Bytes contents, string etag, bool makeBackup, GFileCreateFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2127
2128        /**
2129         * Finishes an asynchronous replace of the given @file. See
2130         * g_file_replace_contents_async(). Sets @new_etag to the new entity
2131         * tag for the document, if present.
2132         *
2133         * Params:
2134         *     res = a #GAsyncResult
2135         *     newEtag = a location of a new [entity tag][gfile-etag]
2136         *         for the document. This should be freed with g_free() when it is no
2137         *         longer needed, or %NULL
2138         *
2139         * Returns: %TRUE on success, %FALSE on failure.
2140         *
2141         * Throws: GException on failure.
2142         */
2143        public bool replaceContentsFinish(AsyncResultIF res, out string newEtag);
2144
2145        /**
2146         * Finishes an asynchronous file replace operation started with
2147         * g_file_replace_async().
2148         *
2149         * Params:
2150         *     res = a #GAsyncResult
2151         *
2152         * Returns: a #GFileOutputStream, or %NULL on error.
2153         *     Free the returned object with g_object_unref().
2154         *
2155         * Throws: GException on failure.
2156         */
2157        public FileOutputStream replaceFinish(AsyncResultIF res);
2158
2159        /**
2160         * Returns an output stream for overwriting the file in readwrite mode,
2161         * possibly creating a backup copy of the file first. If the file doesn't
2162         * exist, it will be created.
2163         *
2164         * For details about the behaviour, see g_file_replace() which does the
2165         * same thing but returns an output stream only.
2166         *
2167         * Note that in many non-local file cases read and write streams are not
2168         * supported, so make sure you really need to do read and write streaming,
2169         * rather than just opening for reading or writing.
2170         *
2171         * Params:
2172         *     etag = an optional [entity tag][gfile-etag]
2173         *         for the current #GFile, or #NULL to ignore
2174         *     makeBackup = %TRUE if a backup should be created
2175         *     flags = a set of #GFileCreateFlags
2176         *     cancellable = optional #GCancellable object,
2177         *         %NULL to ignore
2178         *
2179         * Returns: a #GFileIOStream or %NULL on error.
2180         *     Free the returned object with g_object_unref().
2181         *
2182         * Since: 2.22
2183         *
2184         * Throws: GException on failure.
2185         */
2186        public FileIOStream replaceReadwrite(string etag, bool makeBackup, GFileCreateFlags flags, Cancellable cancellable);
2187
2188        /**
2189         * Asynchronously overwrites the file in read-write mode,
2190         * replacing the contents, possibly creating a backup copy
2191         * of the file first.
2192         *
2193         * For more details, see g_file_replace_readwrite() which is
2194         * the synchronous version of this call.
2195         *
2196         * When the operation is finished, @callback will be called.
2197         * You can then call g_file_replace_readwrite_finish() to get
2198         * the result of the operation.
2199         *
2200         * Params:
2201         *     etag = an [entity tag][gfile-etag] for the current #GFile,
2202         *         or %NULL to ignore
2203         *     makeBackup = %TRUE if a backup should be created
2204         *     flags = a set of #GFileCreateFlags
2205         *     ioPriority = the [I/O priority][io-priority] of the request
2206         *     cancellable = optional #GCancellable object,
2207         *         %NULL to ignore
2208         *     callback = a #GAsyncReadyCallback to call
2209         *         when the request is satisfied
2210         *     userData = the data to pass to callback function
2211         *
2212         * Since: 2.22
2213         */
2214        public void replaceReadwriteAsync(string etag, bool makeBackup, GFileCreateFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2215
2216        /**
2217         * Finishes an asynchronous file replace operation started with
2218         * g_file_replace_readwrite_async().
2219         *
2220         * Params:
2221         *     res = a #GAsyncResult
2222         *
2223         * Returns: a #GFileIOStream, or %NULL on error.
2224         *     Free the returned object with g_object_unref().
2225         *
2226         * Since: 2.22
2227         *
2228         * Throws: GException on failure.
2229         */
2230        public FileIOStream replaceReadwriteFinish(AsyncResultIF res);
2231
2232        /**
2233         * Resolves a relative path for @file to an absolute path.
2234         *
2235         * This call does no blocking I/O.
2236         *
2237         * Params:
2238         *     relativePath = a given relative path string
2239         *
2240         * Returns: #GFile to the resolved path.
2241         *     %NULL if @relative_path is %NULL or if @file is invalid.
2242         *     Free the returned object with g_object_unref().
2243         */
2244        public FileIF resolveRelativePath(string relativePath);
2245
2246        /**
2247         * Sets an attribute in the file with attribute name @attribute to @value.
2248         *
2249         * Some attributes can be unset by setting @attribute to
2250         * %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
2251         *
2252         * If @cancellable is not %NULL, then the operation can be cancelled by
2253         * triggering the cancellable object from another thread. If the operation
2254         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2255         *
2256         * Params:
2257         *     attribute = a string containing the attribute's name
2258         *     type = The type of the attribute
2259         *     valueP = a pointer to the value (or the pointer
2260         *         itself if the type is a pointer type)
2261         *     flags = a set of #GFileQueryInfoFlags
2262         *     cancellable = optional #GCancellable object,
2263         *         %NULL to ignore
2264         *
2265         * Returns: %TRUE if the attribute was set, %FALSE otherwise.
2266         *
2267         * Throws: GException on failure.
2268         */
2269        public bool setAttribute(string attribute, GFileAttributeType type, void* valueP, GFileQueryInfoFlags flags, Cancellable cancellable);
2270
2271        /**
2272         * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
2273         * If @attribute is of a different type, this operation will fail,
2274         * returning %FALSE.
2275         *
2276         * If @cancellable is not %NULL, then the operation can be cancelled by
2277         * triggering the cancellable object from another thread. If the operation
2278         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2279         *
2280         * Params:
2281         *     attribute = a string containing the attribute's name
2282         *     value = a string containing the attribute's new value
2283         *     flags = a #GFileQueryInfoFlags
2284         *     cancellable = optional #GCancellable object,
2285         *         %NULL to ignore
2286         *
2287         * Returns: %TRUE if the @attribute was successfully set to @value
2288         *     in the @file, %FALSE otherwise.
2289         *
2290         * Throws: GException on failure.
2291         */
2292        public bool setAttributeByteString(string attribute, string value, GFileQueryInfoFlags flags, Cancellable cancellable);
2293
2294        /**
2295         * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
2296         * If @attribute is of a different type, this operation will fail.
2297         *
2298         * If @cancellable is not %NULL, then the operation can be cancelled by
2299         * triggering the cancellable object from another thread. If the operation
2300         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2301         *
2302         * Params:
2303         *     attribute = a string containing the attribute's name
2304         *     value = a #gint32 containing the attribute's new value
2305         *     flags = a #GFileQueryInfoFlags
2306         *     cancellable = optional #GCancellable object,
2307         *         %NULL to ignore
2308         *
2309         * Returns: %TRUE if the @attribute was successfully set to @value
2310         *     in the @file, %FALSE otherwise.
2311         *
2312         * Throws: GException on failure.
2313         */
2314        public bool setAttributeInt32(string attribute, int value, GFileQueryInfoFlags flags, Cancellable cancellable);
2315
2316        /**
2317         * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
2318         * If @attribute is of a different type, this operation will fail.
2319         *
2320         * If @cancellable is not %NULL, then the operation can be cancelled by
2321         * triggering the cancellable object from another thread. If the operation
2322         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2323         *
2324         * Params:
2325         *     attribute = a string containing the attribute's name
2326         *     value = a #guint64 containing the attribute's new value
2327         *     flags = a #GFileQueryInfoFlags
2328         *     cancellable = optional #GCancellable object,
2329         *         %NULL to ignore
2330         *
2331         * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
2332         *
2333         * Throws: GException on failure.
2334         */
2335        public bool setAttributeInt64(string attribute, long value, GFileQueryInfoFlags flags, Cancellable cancellable);
2336
2337        /**
2338         * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
2339         * If @attribute is of a different type, this operation will fail.
2340         *
2341         * If @cancellable is not %NULL, then the operation can be cancelled by
2342         * triggering the cancellable object from another thread. If the operation
2343         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2344         *
2345         * Params:
2346         *     attribute = a string containing the attribute's name
2347         *     value = a string containing the attribute's value
2348         *     flags = #GFileQueryInfoFlags
2349         *     cancellable = optional #GCancellable object,
2350         *         %NULL to ignore
2351         *
2352         * Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
2353         *
2354         * Throws: GException on failure.
2355         */
2356        public bool setAttributeString(string attribute, string value, GFileQueryInfoFlags flags, Cancellable cancellable);
2357
2358        /**
2359         * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
2360         * If @attribute is of a different type, this operation will fail.
2361         *
2362         * If @cancellable is not %NULL, then the operation can be cancelled by
2363         * triggering the cancellable object from another thread. If the operation
2364         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2365         *
2366         * Params:
2367         *     attribute = a string containing the attribute's name
2368         *     value = a #guint32 containing the attribute's new value
2369         *     flags = a #GFileQueryInfoFlags
2370         *     cancellable = optional #GCancellable object,
2371         *         %NULL to ignore
2372         *
2373         * Returns: %TRUE if the @attribute was successfully set to @value
2374         *     in the @file, %FALSE otherwise.
2375         *
2376         * Throws: GException on failure.
2377         */
2378        public bool setAttributeUint32(string attribute, uint value, GFileQueryInfoFlags flags, Cancellable cancellable);
2379
2380        /**
2381         * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
2382         * If @attribute is of a different type, this operation will fail.
2383         *
2384         * If @cancellable is not %NULL, then the operation can be cancelled by
2385         * triggering the cancellable object from another thread. If the operation
2386         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2387         *
2388         * Params:
2389         *     attribute = a string containing the attribute's name
2390         *     value = a #guint64 containing the attribute's new value
2391         *     flags = a #GFileQueryInfoFlags
2392         *     cancellable = optional #GCancellable object,
2393         *         %NULL to ignore
2394         *
2395         * Returns: %TRUE if the @attribute was successfully set to @value
2396         *     in the @file, %FALSE otherwise.
2397         *
2398         * Throws: GException on failure.
2399         */
2400        public bool setAttributeUint64(string attribute, ulong value, GFileQueryInfoFlags flags, Cancellable cancellable);
2401
2402        /**
2403         * Asynchronously sets the attributes of @file with @info.
2404         *
2405         * For more details, see g_file_set_attributes_from_info(),
2406         * which is the synchronous version of this call.
2407         *
2408         * When the operation is finished, @callback will be called.
2409         * You can then call g_file_set_attributes_finish() to get
2410         * the result of the operation.
2411         *
2412         * Params:
2413         *     info = a #GFileInfo
2414         *     flags = a #GFileQueryInfoFlags
2415         *     ioPriority = the [I/O priority][io-priority] of the request
2416         *     cancellable = optional #GCancellable object,
2417         *         %NULL to ignore
2418         *     callback = a #GAsyncReadyCallback
2419         *     userData = a #gpointer
2420         */
2421        public void setAttributesAsync(FileInfo info, GFileQueryInfoFlags flags, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2422
2423        /**
2424         * Finishes setting an attribute started in g_file_set_attributes_async().
2425         *
2426         * Params:
2427         *     result = a #GAsyncResult
2428         *     info = a #GFileInfo
2429         *
2430         * Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
2431         *
2432         * Throws: GException on failure.
2433         */
2434        public bool setAttributesFinish(AsyncResultIF result, out FileInfo info);
2435
2436        /**
2437         * Tries to set all attributes in the #GFileInfo on the target
2438         * values, not stopping on the first error.
2439         *
2440         * If there is any error during this operation then @error will
2441         * be set to the first error. Error on particular fields are flagged
2442         * by setting the "status" field in the attribute value to
2443         * %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can
2444         * also detect further errors.
2445         *
2446         * If @cancellable is not %NULL, then the operation can be cancelled by
2447         * triggering the cancellable object from another thread. If the operation
2448         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2449         *
2450         * Params:
2451         *     info = a #GFileInfo
2452         *     flags = #GFileQueryInfoFlags
2453         *     cancellable = optional #GCancellable object,
2454         *         %NULL to ignore
2455         *
2456         * Returns: %FALSE if there was any error, %TRUE otherwise.
2457         *
2458         * Throws: GException on failure.
2459         */
2460        public bool setAttributesFromInfo(FileInfo info, GFileQueryInfoFlags flags, Cancellable cancellable);
2461
2462        /**
2463         * Renames @file to the specified display name.
2464         *
2465         * The display name is converted from UTF-8 to the correct encoding
2466         * for the target filesystem if possible and the @file is renamed to this.
2467         *
2468         * If you want to implement a rename operation in the user interface the
2469         * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
2470         * initial value in the rename widget, and then the result after editing
2471         * should be passed to g_file_set_display_name().
2472         *
2473         * On success the resulting converted filename is returned.
2474         *
2475         * If @cancellable is not %NULL, then the operation can be cancelled by
2476         * triggering the cancellable object from another thread. If the operation
2477         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2478         *
2479         * Params:
2480         *     displayName = a string
2481         *     cancellable = optional #GCancellable object,
2482         *         %NULL to ignore
2483         *
2484         * Returns: a #GFile specifying what @file was renamed to,
2485         *     or %NULL if there was an error.
2486         *     Free the returned object with g_object_unref().
2487         *
2488         * Throws: GException on failure.
2489         */
2490        public FileIF setDisplayName(string displayName, Cancellable cancellable);
2491
2492        /**
2493         * Asynchronously sets the display name for a given #GFile.
2494         *
2495         * For more details, see g_file_set_display_name() which is
2496         * the synchronous version of this call.
2497         *
2498         * When the operation is finished, @callback will be called.
2499         * You can then call g_file_set_display_name_finish() to get
2500         * the result of the operation.
2501         *
2502         * Params:
2503         *     displayName = a string
2504         *     ioPriority = the [I/O priority][io-priority] of the request
2505         *     cancellable = optional #GCancellable object,
2506         *         %NULL to ignore
2507         *     callback = a #GAsyncReadyCallback to call
2508         *         when the request is satisfied
2509         *     userData = the data to pass to callback function
2510         */
2511        public void setDisplayNameAsync(string displayName, int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2512
2513        /**
2514         * Finishes setting a display name started with
2515         * g_file_set_display_name_async().
2516         *
2517         * Params:
2518         *     res = a #GAsyncResult
2519         *
2520         * Returns: a #GFile or %NULL on error.
2521         *     Free the returned object with g_object_unref().
2522         *
2523         * Throws: GException on failure.
2524         */
2525        public FileIF setDisplayNameFinish(AsyncResultIF res);
2526
2527        /**
2528         * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
2529         * Using @start_operation, you can request callbacks when, for instance,
2530         * passwords are needed during authentication.
2531         *
2532         * If @cancellable is not %NULL, then the operation can be cancelled by
2533         * triggering the cancellable object from another thread. If the operation
2534         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2535         *
2536         * When the operation is finished, @callback will be called.
2537         * You can then call g_file_mount_mountable_finish() to get
2538         * the result of the operation.
2539         *
2540         * Params:
2541         *     flags = flags affecting the operation
2542         *     startOperation = a #GMountOperation, or %NULL to avoid user interaction
2543         *     cancellable = optional #GCancellable object, %NULL to ignore
2544         *     callback = a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
2545         *     userData = the data to pass to callback function
2546         *
2547         * Since: 2.22
2548         */
2549        public void startMountable(GDriveStartFlags flags, MountOperation startOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2550
2551        /**
2552         * Finishes a start operation. See g_file_start_mountable() for details.
2553         *
2554         * Finish an asynchronous start operation that was started
2555         * with g_file_start_mountable().
2556         *
2557         * Params:
2558         *     result = a #GAsyncResult
2559         *
2560         * Returns: %TRUE if the operation finished successfully. %FALSE
2561         *     otherwise.
2562         *
2563         * Since: 2.22
2564         *
2565         * Throws: GException on failure.
2566         */
2567        public bool startMountableFinish(AsyncResultIF result);
2568
2569        /**
2570         * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
2571         *
2572         * If @cancellable is not %NULL, then the operation can be cancelled by
2573         * triggering the cancellable object from another thread. If the operation
2574         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2575         *
2576         * When the operation is finished, @callback will be called.
2577         * You can then call g_file_stop_mountable_finish() to get
2578         * the result of the operation.
2579         *
2580         * Params:
2581         *     flags = flags affecting the operation
2582         *     mountOperation = a #GMountOperation,
2583         *         or %NULL to avoid user interaction.
2584         *     cancellable = optional #GCancellable object,
2585         *         %NULL to ignore
2586         *     callback = a #GAsyncReadyCallback to call
2587         *         when the request is satisfied, or %NULL
2588         *     userData = the data to pass to callback function
2589         *
2590         * Since: 2.22
2591         */
2592        public void stopMountable(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2593
2594        /**
2595         * Finishes an stop operation, see g_file_stop_mountable() for details.
2596         *
2597         * Finish an asynchronous stop operation that was started
2598         * with g_file_stop_mountable().
2599         *
2600         * Params:
2601         *     result = a #GAsyncResult
2602         *
2603         * Returns: %TRUE if the operation finished successfully.
2604         *     %FALSE otherwise.
2605         *
2606         * Since: 2.22
2607         *
2608         * Throws: GException on failure.
2609         */
2610        public bool stopMountableFinish(AsyncResultIF result);
2611
2612        /**
2613         * Checks if @file supports
2614         * [thread-default contexts][g-main-context-push-thread-default-context].
2615         * If this returns %FALSE, you cannot perform asynchronous operations on
2616         * @file in a thread that has a thread-default context.
2617         *
2618         * Returns: Whether or not @file supports thread-default contexts.
2619         *
2620         * Since: 2.22
2621         */
2622        public bool supportsThreadContexts();
2623
2624        /**
2625         * Sends @file to the "Trashcan", if possible. This is similar to
2626         * deleting it, but the user can recover it before emptying the trashcan.
2627         * Not all file systems support trashing, so this call can return the
2628         * %G_IO_ERROR_NOT_SUPPORTED error.
2629         *
2630         * If @cancellable is not %NULL, then the operation can be cancelled by
2631         * triggering the cancellable object from another thread. If the operation
2632         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2633         *
2634         * Params:
2635         *     cancellable = optional #GCancellable object,
2636         *         %NULL to ignore
2637         *
2638         * Returns: %TRUE on successful trash, %FALSE otherwise.
2639         *
2640         * Throws: GException on failure.
2641         */
2642        public bool trash(Cancellable cancellable);
2643
2644        /**
2645         * Asynchronously sends @file to the Trash location, if possible.
2646         *
2647         * Params:
2648         *     ioPriority = the [I/O priority][io-priority] of the request
2649         *     cancellable = optional #GCancellable object,
2650         *         %NULL to ignore
2651         *     callback = a #GAsyncReadyCallback to call
2652         *         when the request is satisfied
2653         *     userData = the data to pass to callback function
2654         *
2655         * Since: 2.38
2656         */
2657        public void trashAsync(int ioPriority, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2658
2659        /**
2660         * Finishes an asynchronous file trashing operation, started with
2661         * g_file_trash_async().
2662         *
2663         * Params:
2664         *     result = a #GAsyncResult
2665         *
2666         * Returns: %TRUE on successful trash, %FALSE otherwise.
2667         *
2668         * Since: 2.38
2669         *
2670         * Throws: GException on failure.
2671         */
2672        public bool trashFinish(AsyncResultIF result);
2673
2674        /**
2675         * Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
2676         *
2677         * If @cancellable is not %NULL, then the operation can be cancelled by
2678         * triggering the cancellable object from another thread. If the operation
2679         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2680         *
2681         * When the operation is finished, @callback will be called.
2682         * You can then call g_file_unmount_mountable_finish() to get
2683         * the result of the operation.
2684         *
2685         * Deprecated: Use g_file_unmount_mountable_with_operation() instead.
2686         *
2687         * Params:
2688         *     flags = flags affecting the operation
2689         *     cancellable = optional #GCancellable object,
2690         *         %NULL to ignore
2691         *     callback = a #GAsyncReadyCallback to call
2692         *         when the request is satisfied, or %NULL
2693         *     userData = the data to pass to callback function
2694         */
2695        public void unmountMountable(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2696
2697        /**
2698         * Finishes an unmount operation, see g_file_unmount_mountable() for details.
2699         *
2700         * Finish an asynchronous unmount operation that was started
2701         * with g_file_unmount_mountable().
2702         *
2703         * Deprecated: Use g_file_unmount_mountable_with_operation_finish()
2704         * instead.
2705         *
2706         * Params:
2707         *     result = a #GAsyncResult
2708         *
2709         * Returns: %TRUE if the operation finished successfully.
2710         *     %FALSE otherwise.
2711         *
2712         * Throws: GException on failure.
2713         */
2714        public bool unmountMountableFinish(AsyncResultIF result);
2715
2716        /**
2717         * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
2718         *
2719         * If @cancellable is not %NULL, then the operation can be cancelled by
2720         * triggering the cancellable object from another thread. If the operation
2721         * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
2722         *
2723         * When the operation is finished, @callback will be called.
2724         * You can then call g_file_unmount_mountable_finish() to get
2725         * the result of the operation.
2726         *
2727         * Params:
2728         *     flags = flags affecting the operation
2729         *     mountOperation = a #GMountOperation,
2730         *         or %NULL to avoid user interaction
2731         *     cancellable = optional #GCancellable object,
2732         *         %NULL to ignore
2733         *     callback = a #GAsyncReadyCallback to call
2734         *         when the request is satisfied, or %NULL
2735         *     userData = the data to pass to callback function
2736         *
2737         * Since: 2.22
2738         */
2739        public void unmountMountableWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData);
2740
2741        /**
2742         * Finishes an unmount operation,
2743         * see g_file_unmount_mountable_with_operation() for details.
2744         *
2745         * Finish an asynchronous unmount operation that was started
2746         * with g_file_unmount_mountable_with_operation().
2747         *
2748         * Params:
2749         *     result = a #GAsyncResult
2750         *
2751         * Returns: %TRUE if the operation finished successfully.
2752         *     %FALSE otherwise.
2753         *
2754         * Since: 2.22
2755         *
2756         * Throws: GException on failure.
2757         */
2758        public bool unmountMountableWithOperationFinish(AsyncResultIF result);
2759}
Note: See TracBrowser for help on using the repository browser.