Another round of trivial doc fixes
[platform/upstream/glib.git] / gio / gfile.h
1 /* GIO - GLib Input, Output and Streaming Library
2  * 
3  * Copyright (C) 2006-2007 Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Alexander Larsson <alexl@redhat.com>
21  */
22
23 #ifndef __G_FILE_H__
24 #define __G_FILE_H__
25
26 #include <glib-object.h>
27 #include <gio/gfileinfo.h>
28 #include <gio/gfileenumerator.h>
29 #include <gio/gfileinputstream.h>
30 #include <gio/gfileoutputstream.h>
31 #include <gio/gmountoperation.h>
32
33 G_BEGIN_DECLS
34
35 #define G_TYPE_FILE            (g_file_get_type ())
36 #define G_FILE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_FILE, GFile))
37 #define G_IS_FILE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_FILE))
38 #define G_FILE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_FILE, GFileIface))
39
40 /**
41  * GFileQueryInfoFlags:
42  * @G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS: Don't follow symlinks.
43  * 
44  * Flags used when querying a #GFileInfo.
45  */
46 typedef enum {
47   G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1<<0)
48 } GFileQueryInfoFlags;
49
50 /**
51  * GFileCreateFlags:
52  * @G_FILE_CREATE_FLAGS_NONE: No flags set.
53  * @G_FILE_CREATE_FLAGS_PRIVATE: Create a file that can only be 
54  *    accessed by the current user.
55  * 
56  * Flags used when an operation may create a file.
57  */
58 typedef enum  {
59   G_FILE_CREATE_FLAGS_NONE = 0,
60   G_FILE_CREATE_FLAGS_PRIVATE = (1<<0)
61 } GFileCreateFlags;
62
63 /**
64  * GFileCopyFlags:
65  * @G_FILE_COPY_OVERWRITE: Overwrite any existing files
66  * @G_FILE_COPY_BACKUP: Make a backup of any existing files. TODO: explain backup naming scheme.
67  * @G_FILE_COPY_NOFOLLOW_SYMLINKS: Don't follow symlinks.
68  * @G_FILE_COPY_ALL_METADATA: Copy all file metadata (see #GFileInfo).
69  *
70  * Flags used when copying or moving files. 
71  */
72 typedef enum {
73   G_FILE_COPY_OVERWRITE = (1<<0),
74   G_FILE_COPY_BACKUP = (1<<1),
75   G_FILE_COPY_NOFOLLOW_SYMLINKS = (1<<2),
76   G_FILE_COPY_ALL_METADATA = (1<<3)
77 } GFileCopyFlags;
78
79 /**
80  * GFileMonitorFlags:
81  * @G_FILE_MONITOR_FLAGS_NONE: No flags set.
82  * @G_FILE_MONITOR_FLAGS_MONITOR_MOUNTS: Watch for mount events. 
83  *
84  * Flags used to set what a #GFileMonitor or #GDirectoryMonitor will watch for. 
85  */
86 typedef enum  {
87   G_FILE_MONITOR_FLAGS_NONE = 0,
88   G_FILE_MONITOR_FLAGS_MONITOR_MOUNTS = (1<<0)
89 } GFileMonitorFlags;
90
91 /**
92  * GFile:
93  * 
94  * A handle to an object implementing the #GFileIface interface. 
95  * Generally stores a location within the file system. Handles do not 
96  * necessarily represent files or directories that currently exist.
97  **/
98 typedef struct _GFile                   GFile; /* Dummy typedef */
99 typedef struct _GFileIface              GFileIface;
100 typedef struct _GDirectoryMonitor       GDirectoryMonitor;
101 typedef struct _GFileMonitor            GFileMonitor;
102
103 /**
104  * GVolume:
105  * 
106  * A handle to an object implementing the #GVolumeIface interface.
107  **/
108 typedef struct _GVolume         GVolume; /* Dummy typedef */
109
110 /**
111  * GFileProgressCallback:
112  * @current_num_bytes: the current number of bytes in the operation.
113  * @total_num_bytes: the total number of bytes in the operation.
114  * @user_data: user data passed to the callback.
115  *
116  * When doing file operations that may take a while, such as moving 
117  * a file or copying a file, a progress callback is used to pass how 
118  * far along that operation is to the application. 
119  **/
120 typedef void (*GFileProgressCallback) (goffset current_num_bytes,
121                                        goffset total_num_bytes,
122                                        gpointer user_data);
123
124 /**
125  * GFileReadMoreCallback:
126  * @file_contents:
127  * @file_size:
128  * @callback_data:
129  *
130  * 
131  **/
132 typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
133                                             goffset file_size,
134                                             gpointer callback_data);
135
136 /**
137  * GFileIface:
138  * @g_iface: The parent interface.
139  * @dup: Duplicates a #GFile.
140  * @hash: Creates a hash of a #GFile.
141  * @equal: Checks equality of two given #GFile<!-- -->s.
142  * @is_native: Checks to see if a file is native to the system.
143  * @has_uri_scheme: Checks to see if a #GFile has a given URI scheme.
144  * @get_uri_scheme: Gets the URI scheme for a #GFile.
145  * @get_basename: Gets the basename for a given #GFile.
146  * @get_path: Gets the current path within a #GFile. 
147  * @get_uri: Gets a URI for the path within a #GFile.
148  * @get_parse_name: Gets the parsed name for the #GFile.
149  * @get_parent: Gets the parent directory for the #GFile.
150  * @contains_file: Checks whether a #GFile contains a specified file.
151  * @get_relative_path: Gets the path for a #GFile relative to a given path.
152  * @resolve_relative_path: Resolves a relative path for a #GFile to an absolute path.
153  * @get_child_for_display_name: Gets the child #GFile for a given display name.
154  * @enumerate_children: Gets a #GFileEnumerator with the children of a #GFile.
155  * @enumerate_children_async: Asynchronously gets a #GFileEnumerator with the children of a #GFile.
156  * @enumerate_children_finish: Finishes asynchronously enumerating the children.
157  * @query_info: Gets the #GFileInfo for a #GFile.
158  * @query_info_async: Asynchronously gets the #GFileInfo for a #GFile.
159  * @query_info_finish: Finishes an asynchronous query info operation.
160  * @query_filesystem_info: Gets a #GFileInfo for the file system #GFile is on.
161  * @_query_filesystem_info_async: Asynchronously gets a #GFileInfo for the file system #GFile is on.
162  * @_query_filesystem_info_finish: Finishes asynchronously getting the file system info.
163  * @find_enclosing_volume: Gets a #GVolume for the #GFile.
164  * @find_enclosing_volume_async: Asynchronously gets the #GVolume for a #GFile.
165  * @find_enclosing_volume_finish: Finishes asynchronously getting the volume.
166  * @set_display_name: Sets the display name for a #GFile.
167  * @set_display_name_async: Asynchronously sets a #GFile's display name.
168  * @set_display_name_finish: Finishes asynchronously setting a #GFile's display name.
169  * @query_settable_attributes: Returns a list of #GFileAttribute<!-- -->s that can be set.
170  * @_query_settable_attributes_async: Asynchronously gets a list of #GFileAttribute<!-- -->s that can be set.
171  * @_query_settable_attributes_finish: Finishes asynchronously querying settable attributes.
172  * @query_writable_namespaces: Returns a list of #GFileAttribute namespaces that are writable.
173  * @_query_writable_namespaces_async: Asynchronously gets a list of #GFileAttribute namespaces that are writable.
174  * @_query_writable_namespaces_finish: Finishes asynchronously querying the writable namespaces.
175  * @set_attribute: Sets a #GFileAttribute.
176  * @set_attributes_from_info: Sets a #GFileAttribute with information from a #GFileInfo.
177  * @set_attributes_async: Asynchronously sets a file's attributes.
178  * @set_attributes_finish: Finishes setting a file's attributes asynchronously.
179  * @read: Reads a file asynchronously.
180  * @read_async: Asynchronously reads a file.
181  * @read_finish: Finishes asynchronously reading a file.
182  * @append_to: Writes to the end of a file.
183  * @append_to_async: Asynchronously writes to the end of a file.
184  * @append_to_finish: Finishes an asynchronous file append operation.
185  * @create: Creates a new file.
186  * @create_async: Asynchronously creates a file.
187  * @create_finish: Finishes asynchronously creating a file.
188  * @replace: Replaces the contents of a file.
189  * @replace_async: Asynchronously replaces the contents of a file.
190  * @replace_finish: Finishes asynchronously replacing a file.
191  * @delete_file: Deletes a file.
192  * @_delete_file_async: Asynchronously deletes a file.
193  * @_delete_file_finish: Finishes an asynchronous delete.
194  * @trash: Sends a #GFile to the Trash location.
195  * @_trash_async: Asynchronously sends a #GFile to the Trash location.
196  * @_trash_finish: Finishes an asynchronous file trashing operation.
197  * @make_directory: Makes a directory.
198  * @_make_directory_async: Asynchronously makes a directory.
199  * @_make_directory_finish: Finishes making a directory asynchronously.
200  * @make_symbolic_link: Makes a symbolic link.
201  * @_make_symbolic_link_async: Asynchronously makes a symbolic link
202  * @_make_symbolic_link_finish: Finishes making a symbolic link asynchronously.
203  * @copy: Copies a file.
204  * @_copy_async: Asynchronously copies a file.
205  * @_copy_finish: Finishes an asynchronous copy operation.
206  * @move: Moves a file.
207  * @_move_async: Asynchronously moves a file. 
208  * @_move_finish: Finishes an asynchronous move operation.
209  * @mount_mountable: Mounts a mountable object.
210  * @mount_mountable_finish: Finishes a mounting operation.
211  * @unmount_mountable: Unmounts a mountable object.
212  * @unmount_mountable_finish: Finishes an unmount operation.
213  * @eject_mountable: Ejects a mountable.
214  * @eject_mountable_finish: Finishes an eject operation.
215  * @mount_for_location: Mounts a specified location. 
216  * @mount_for_location_finish: Finishes mounting a specified location.
217  * @monitor_dir: Creates a #GDirectoryMonitor for the location.
218  * @monitor_file: Creates a #GFileMonitor for the location.
219  * 
220  * An interface for writing VFS file handles.  
221  **/ 
222 struct _GFileIface
223 {
224   GTypeInterface g_iface;
225
226   /* Virtual Table */
227
228   GFile *             (*dup)                        (GFile         *file);
229   guint               (*hash)                       (GFile         *file);
230   gboolean            (*equal)                      (GFile         *file1,
231                                                      GFile         *file2);
232   gboolean            (*is_native)                  (GFile         *file);
233   gboolean            (*has_uri_scheme)             (GFile         *file,
234                                                      const char    *uri_scheme);
235   char *              (*get_uri_scheme)             (GFile         *file);
236   char *              (*get_basename)               (GFile         *file);
237   char *              (*get_path)                   (GFile         *file);
238   char *              (*get_uri)                    (GFile         *file);
239   char *              (*get_parse_name)             (GFile         *file);
240   GFile *             (*get_parent)                 (GFile         *file);
241   gboolean            (*contains_file)              (GFile         *parent,
242                                                      GFile         *descendant);
243   char *              (*get_relative_path)          (GFile         *parent,
244                                                      GFile         *descendant);
245   GFile *             (*resolve_relative_path)      (GFile        *file,
246                                                      const char   *relative_path);
247   GFile *             (*get_child_for_display_name) (GFile        *file,
248                                                      const char   *display_name,
249                                                      GError      **error);
250   
251   GFileEnumerator *   (*enumerate_children)        (GFile                *file,
252                                                     const char           *attributes,
253                                                     GFileQueryInfoFlags   flags,
254                                                     GCancellable         *cancellable,
255                                                     GError              **error);
256   void                (*enumerate_children_async)  (GFile                      *file,
257                                                     const char                 *attributes,
258                                                     GFileQueryInfoFlags         flags,
259                                                     int                         io_priority,
260                                                     GCancellable               *cancellable,
261                                                     GAsyncReadyCallback         callback,
262                                                     gpointer                    user_data);
263   GFileEnumerator *   (*enumerate_children_finish) (GFile                      *file,
264                                                     GAsyncResult               *res,
265                                                     GError                    **error);
266   
267   GFileInfo *         (*query_info)         (GFile                *file,
268                                              const char           *attributes,
269                                              GFileQueryInfoFlags   flags,
270                                              GCancellable         *cancellable,
271                                              GError              **error);
272   void                (*query_info_async)   (GFile                *file,
273                                              const char           *attributes,
274                                              GFileQueryInfoFlags   flags,
275                                              int                   io_priority,
276                                              GCancellable         *cancellable,
277                                              GAsyncReadyCallback   callback,
278                                              gpointer              user_data);
279   GFileInfo *         (*query_info_finish)  (GFile                *file,
280                                              GAsyncResult         *res,
281                                              GError              **error);
282   
283   GFileInfo *         (*query_filesystem_info)(GFile                *file,
284                                              const char           *attributes,
285                                              GCancellable         *cancellable,
286                                              GError              **error);
287   void                (*_query_filesystem_info_async) (void);
288   void                (*_query_filesystem_info_finish) (void);
289   
290   GVolume *           (*find_enclosing_volume)(GFile              *file,
291                                                GCancellable       *cancellable,
292                                                GError            **error);
293   void                (*find_enclosing_volume_async)(GFile              *file,
294                                                      int                   io_priority,
295                                                      GCancellable         *cancellable,
296                                                      GAsyncReadyCallback   callback,
297                                                      gpointer              user_data);
298   GVolume *           (*find_enclosing_volume_finish)(GFile              *file,
299                                                       GAsyncResult         *res,
300                                                       GError            **error);
301   
302   GFile *             (*set_display_name)         (GFile                *file,
303                                                    const char           *display_name,
304                                                    GCancellable         *cancellable,
305                                                    GError              **error);
306   void                (*set_display_name_async)   (GFile                      *file,
307                                                    const char                 *display_name,
308                                                    int                         io_priority,
309                                                    GCancellable               *cancellable,
310                                                    GAsyncReadyCallback         callback,
311                                                    gpointer                    user_data);
312   GFile *              (*set_display_name_finish) (GFile                      *file,
313                                                    GAsyncResult               *res,
314                                                    GError                    **error);
315   
316   GFileAttributeInfoList * (*query_settable_attributes) (GFile        *file,
317                                                          GCancellable *cancellable,
318                                                          GError      **error);
319   void                (*_query_settable_attributes_async) (void);
320   void                (*_query_settable_attributes_finish) (void);
321   
322   GFileAttributeInfoList * (*query_writable_namespaces) (GFile        *file,
323                                                          GCancellable *cancellable,
324                                                          GError      **error);
325   void                (*_query_writable_namespaces_async) (void);
326   void                (*_query_writable_namespaces_finish) (void);
327   
328   gboolean            (*set_attribute)            (GFile                *file,
329                                                    const char           *attribute,
330                                                    const GFileAttributeValue *value,
331                                                    GFileQueryInfoFlags   flags,
332                                                    GCancellable         *cancellable,
333                                                    GError              **error);
334   gboolean            (*set_attributes_from_info) (GFile          *file,
335                                                    GFileInfo            *info,
336                                                    GFileQueryInfoFlags   flags,
337                                                    GCancellable         *cancellable,
338                                                    GError              **error);
339   void                (*set_attributes_async)     (GFile                      *file,
340                                                    GFileInfo                  *info,
341                                                    GFileQueryInfoFlags        flags,
342                                                    int                         io_priority,
343                                                    GCancellable               *cancellable,
344                                                    GAsyncReadyCallback         callback,
345                                                    gpointer                    user_data);
346   gboolean            (*set_attributes_finish)    (GFile                      *file,
347                                                    GAsyncResult               *result,
348                                                    GFileInfo                 **info,
349                                                    GError                    **error);
350   
351   GFileInputStream *  (*read)               (GFile                *file,
352                                              GCancellable         *cancellable,
353                                              GError              **error);
354   void                (*read_async)         (GFile                *file,
355                                              int                   io_priority,
356                                              GCancellable         *cancellable,
357                                              GAsyncReadyCallback   callback,
358                                              gpointer              user_data);
359   GFileInputStream *  (*read_finish)        (GFile                *file,
360                                              GAsyncResult         *res,
361                                              GError              **error);
362   
363   GFileOutputStream * (*append_to)          (GFile                *file,
364                                              GFileCreateFlags      flags,
365                                              GCancellable         *cancellable,
366                                              GError               **error);
367   void                 (*append_to_async)   (GFile                      *file,
368                                              GFileCreateFlags            flags,
369                                              int                         io_priority,
370                                              GCancellable               *cancellable,
371                                              GAsyncReadyCallback         callback,
372                                              gpointer                    user_data);
373   GFileOutputStream *  (*append_to_finish)  (GFile                      *file,
374                                              GAsyncResult               *res,
375                                              GError                    **error);
376   
377   GFileOutputStream * (*create)             (GFile                *file,
378                                              GFileCreateFlags      flags,
379                                              GCancellable         *cancellable,
380                                              GError               **error);
381   void                 (*create_async)      (GFile                      *file,
382                                              GFileCreateFlags            flags,
383                                              int                         io_priority,
384                                              GCancellable               *cancellable,
385                                              GAsyncReadyCallback         callback,
386                                              gpointer                    user_data);
387   GFileOutputStream *  (*create_finish)     (GFile                      *file,
388                                              GAsyncResult               *res,
389                                              GError                    **error);
390   
391   GFileOutputStream *  (*replace)           (GFile                *file,
392                                              const char           *etag,
393                                              gboolean              make_backup,
394                                              GFileCreateFlags      flags,
395                                              GCancellable         *cancellable,
396                                              GError              **error);
397   void                 (*replace_async)     (GFile                      *file,
398                                              const char                 *etag,
399                                              gboolean                    make_backup,
400                                              GFileCreateFlags            flags,
401                                              int                         io_priority,
402                                              GCancellable               *cancellable,
403                                              GAsyncReadyCallback         callback,
404                                              gpointer                    user_data);
405   GFileOutputStream *  (*replace_finish)    (GFile                      *file,
406                                              GAsyncResult               *res,
407                                              GError                    **error);
408   
409   gboolean            (*delete_file)        (GFile                *file,
410                                              GCancellable         *cancellable,
411                                              GError              **error);
412   void                (*_delete_file_async) (void);
413   void                (*_delete_file_finish) (void);
414   
415   gboolean            (*trash)              (GFile                *file,
416                                              GCancellable         *cancellable,
417                                              GError              **error);
418   void                (*_trash_async) (void);
419   void                (*_trash_finish) (void);
420   
421   gboolean            (*make_directory)     (GFile                *file,
422                                              GCancellable         *cancellable,
423                                              GError              **error);
424   void                (*_make_directory_async) (void);
425   void                (*_make_directory_finish) (void);
426   
427   gboolean            (*make_symbolic_link) (GFile                *file,
428                                              const char           *symlink_value,
429                                              GCancellable         *cancellable,
430                                              GError              **error);
431   void                (*_make_symbolic_link_async) (void);
432   void                (*_make_symbolic_link_finish) (void);
433   
434   gboolean            (*copy)               (GFile                *source,
435                                              GFile                *destination,
436                                              GFileCopyFlags        flags,
437                                              GCancellable         *cancellable,
438                                              GFileProgressCallback progress_callback,
439                                              gpointer              progress_callback_data,
440                                              GError              **error);
441   void                (*_copy_async) (void);
442   void                (*_copy_finish) (void);
443   
444   gboolean            (*move)               (GFile                *source,
445                                              GFile                *destination,
446                                              GFileCopyFlags        flags,
447                                              GCancellable         *cancellable,
448                                              GFileProgressCallback progress_callback,
449                                              gpointer              progress_callback_data,
450                                              GError              **error);
451
452   void                (*_move_async) (void);
453   void                (*_move_finish) (void);
454
455
456   void                (*mount_mountable)           (GFile               *file,
457                                                     GMountOperation     *mount_operation,
458                                                     GCancellable         *cancellable,
459                                                     GAsyncReadyCallback  callback,
460                                                     gpointer             user_data);
461   GFile *             (*mount_mountable_finish)    (GFile               *file,
462                                                     GAsyncResult        *result,
463                                                     GError             **error);
464   void                (*unmount_mountable)         (GFile               *file,
465                                                     GCancellable         *cancellable,
466                                                     GAsyncReadyCallback  callback,
467                                                     gpointer             user_data);
468   gboolean            (*unmount_mountable_finish)  (GFile               *file,
469                                                     GAsyncResult        *result,
470                                                     GError             **error);
471   void                (*eject_mountable)           (GFile               *file,
472                                                     GCancellable        *cancellable,
473                                                     GAsyncReadyCallback  callback,
474                                                     gpointer             user_data);
475   gboolean            (*eject_mountable_finish)    (GFile               *file,
476                                                     GAsyncResult        *result,
477                                                     GError             **error);
478
479
480   void     (*mount_for_location)        (GFile *location,
481                                          GMountOperation *mount_operation,
482                                          GCancellable *cancellable,
483                                          GAsyncReadyCallback callback,
484                                          gpointer user_data);
485   gboolean (*mount_for_location_finish) (GFile *location,
486                                          GAsyncResult *result,
487                                          GError **error);
488   
489   GDirectoryMonitor* (*monitor_dir)         (GFile                  *file,
490                                              GFileMonitorFlags       flags,
491                                              GCancellable           *cancellable);
492
493   GFileMonitor*      (*monitor_file)        (GFile                  *file,
494                                              GFileMonitorFlags       flags,
495                                              GCancellable           *cancellable);
496
497 };
498
499 GType g_file_get_type (void) G_GNUC_CONST;
500
501 GFile *                 g_file_new_for_path               (const char                 *path);
502 GFile *                 g_file_new_for_uri                (const char                 *uri);
503 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
504 GFile *                 g_file_parse_name                 (const char                 *parse_name);
505 GFile *                 g_file_dup                        (GFile                      *file);
506 guint                   g_file_hash                       (gconstpointer               file);
507 gboolean                g_file_equal                      (GFile                      *file1,
508                                                            GFile                      *file2);
509 char *                  g_file_get_basename               (GFile                      *file);
510 char *                  g_file_get_path                   (GFile                      *file);
511 char *                  g_file_get_uri                    (GFile                      *file);
512 char *                  g_file_get_parse_name             (GFile                      *file);
513 GFile *                 g_file_get_parent                 (GFile                      *file);
514 GFile *                 g_file_get_child                  (GFile                      *file,
515                                                            const char                 *name);
516 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
517                                                            const char                 *display_name,
518                                                            GError                    **error);
519 gboolean                g_file_contains_file              (GFile                      *parent,
520                                                            GFile                      *descendant);
521 char *                  g_file_get_relative_path          (GFile                      *parent,
522                                                            GFile                      *descendant);
523 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
524                                                            const char                 *relative_path);
525 gboolean                g_file_is_native                  (GFile                      *file);
526 gboolean                g_file_has_uri_scheme             (GFile                      *file,
527                                                            const char                 *uri_scheme);
528 char *                  g_file_get_uri_scheme             (GFile                      *file);
529 GFileInputStream *      g_file_read                       (GFile                      *file,
530                                                            GCancellable               *cancellable,
531                                                            GError                    **error);
532 void                    g_file_read_async                 (GFile                      *file,
533                                                            int                         io_priority,
534                                                            GCancellable               *cancellable,
535                                                            GAsyncReadyCallback         callback,
536                                                            gpointer                    user_data);
537 GFileInputStream *      g_file_read_finish                (GFile                      *file,
538                                                            GAsyncResult               *res,
539                                                            GError                    **error);
540 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
541                                                            GFileCreateFlags             flags,
542                                                            GCancellable               *cancellable,
543                                                            GError                    **error);
544 GFileOutputStream *     g_file_create                     (GFile                      *file,
545                                                            GFileCreateFlags             flags,
546                                                            GCancellable               *cancellable,
547                                                            GError                    **error);
548 GFileOutputStream *     g_file_replace                    (GFile                      *file,
549                                                            const char                 *etag,
550                                                            gboolean                    make_backup,
551                                                            GFileCreateFlags            flags,
552                                                            GCancellable               *cancellable,
553                                                            GError                    **error);
554 void                    g_file_append_to_async            (GFile                      *file,
555                                                            GFileCreateFlags            flags,
556                                                            int                         io_priority,
557                                                            GCancellable               *cancellable,
558                                                            GAsyncReadyCallback         callback,
559                                                            gpointer                    user_data);
560 GFileOutputStream *     g_file_append_to_finish           (GFile                      *file,
561                                                            GAsyncResult               *res,
562                                                            GError                    **error);
563 void                    g_file_create_async               (GFile                      *file,
564                                                            GFileCreateFlags            flags,
565                                                            int                         io_priority,
566                                                            GCancellable               *cancellable,
567                                                            GAsyncReadyCallback         callback,
568                                                            gpointer                    user_data);
569 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
570                                                            GAsyncResult               *res,
571                                                            GError                    **error);
572 void                    g_file_replace_async              (GFile                      *file,
573                                                            const char                 *etag,
574                                                            gboolean                    make_backup,
575                                                            GFileCreateFlags            flags,
576                                                            int                         io_priority,
577                                                            GCancellable               *cancellable,
578                                                            GAsyncReadyCallback         callback,
579                                                            gpointer                    user_data);
580 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
581                                                            GAsyncResult               *res,
582                                                            GError                    **error);
583 GFileInfo *             g_file_query_info                 (GFile                      *file,
584                                                            const char                 *attributes,
585                                                            GFileQueryInfoFlags         flags,
586                                                            GCancellable               *cancellable,
587                                                            GError                    **error);
588 void                    g_file_query_info_async           (GFile                      *file,
589                                                            const char                 *attributes,
590                                                            GFileQueryInfoFlags         flags,
591                                                            int                         io_priority,
592                                                            GCancellable               *cancellable,
593                                                            GAsyncReadyCallback         callback,
594                                                            gpointer                    user_data);
595 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
596                                                            GAsyncResult               *res,
597                                                            GError                    **error);
598 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
599                                                            const char                 *attributes,
600                                                            GCancellable               *cancellable,
601                                                            GError                    **error);
602 GVolume *               g_file_find_enclosing_volume      (GFile                      *file,
603                                                            GCancellable               *cancellable,
604                                                            GError                    **error);
605 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
606                                                            const char                 *attributes,
607                                                            GFileQueryInfoFlags         flags,
608                                                            GCancellable               *cancellable,
609                                                            GError                    **error);
610 void                    g_file_enumerate_children_async   (GFile                      *file,
611                                                            const char                 *attributes,
612                                                            GFileQueryInfoFlags         flags,
613                                                            int                         io_priority,
614                                                            GCancellable               *cancellable,
615                                                            GAsyncReadyCallback         callback,
616                                                            gpointer                    user_data);
617 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
618                                                            GAsyncResult               *res,
619                                                            GError                    **error);
620 GFile *                 g_file_set_display_name           (GFile                      *file,
621                                                            const char                 *display_name,
622                                                            GCancellable               *cancellable,
623                                                            GError                    **error);
624 void                    g_file_set_display_name_async     (GFile                      *file,
625                                                            const char                 *display_name,
626                                                            int                         io_priority,
627                                                            GCancellable               *cancellable,
628                                                            GAsyncReadyCallback         callback,
629                                                            gpointer                    user_data);
630 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
631                                                            GAsyncResult               *res,
632                                                            GError                    **error);
633 gboolean                g_file_delete                     (GFile                      *file,
634                                                            GCancellable               *cancellable,
635                                                            GError                    **error);
636 gboolean                g_file_trash                      (GFile                      *file,
637                                                            GCancellable               *cancellable,
638                                                            GError                    **error);
639 gboolean                g_file_copy                       (GFile                      *source,
640                                                            GFile                      *destination,
641                                                            GFileCopyFlags              flags,
642                                                            GCancellable               *cancellable,
643                                                            GFileProgressCallback       progress_callback,
644                                                            gpointer                    progress_callback_data,
645                                                            GError                    **error);
646 gboolean                g_file_move                       (GFile                      *source,
647                                                            GFile                      *destination,
648                                                            GFileCopyFlags              flags,
649                                                            GCancellable               *cancellable,
650                                                            GFileProgressCallback       progress_callback,
651                                                            gpointer                    progress_callback_data,
652                                                            GError                    **error);
653 gboolean                g_file_make_directory             (GFile                      *file,
654                                                            GCancellable               *cancellable,
655                                                            GError                    **error);
656 gboolean                g_file_make_symbolic_link         (GFile                      *file,
657                                                            const char                 *symlink_value,
658                                                            GCancellable               *cancellable,
659                                                            GError                    **error);
660 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
661                                                            GCancellable               *cancellable,
662                                                            GError                    **error);
663 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
664                                                            GCancellable               *cancellable,
665                                                            GError                    **error);
666 gboolean                g_file_set_attribute              (GFile                      *file,
667                                                            const char                 *attribute,
668                                                            const GFileAttributeValue  *value,
669                                                            GFileQueryInfoFlags         flags,
670                                                            GCancellable               *cancellable,
671                                                            GError                    **error);
672 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
673                                                            GFileInfo                  *info,
674                                                            GFileQueryInfoFlags         flags,
675                                                            GCancellable               *cancellable,
676                                                            GError                    **error);
677 void                    g_file_set_attributes_async       (GFile                      *file,
678                                                            GFileInfo                  *info,
679                                                            GFileQueryInfoFlags         flags,
680                                                            int                         io_priority,
681                                                            GCancellable               *cancellable,
682                                                            GAsyncReadyCallback         callback,
683                                                            gpointer                    user_data);
684 gboolean                g_file_set_attributes_finish      (GFile                      *file,
685                                                            GAsyncResult               *result,
686                                                            GFileInfo                 **info,
687                                                            GError                    **error);
688 gboolean                g_file_set_attribute_string       (GFile                      *file,
689                                                            const char                 *attribute,
690                                                            const char                 *value,
691                                                            GFileQueryInfoFlags         flags,
692                                                            GCancellable               *cancellable,
693                                                            GError                    **error);
694 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
695                                                            const char                 *attribute,
696                                                            const char                 *value,
697                                                            GFileQueryInfoFlags         flags,
698                                                            GCancellable               *cancellable,
699                                                            GError                    **error);
700 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
701                                                            const char                 *attribute,
702                                                            guint32                     value,
703                                                            GFileQueryInfoFlags         flags,
704                                                            GCancellable               *cancellable,
705                                                            GError                    **error);
706 gboolean                g_file_set_attribute_int32        (GFile                      *file,
707                                                            const char                 *attribute,
708                                                            gint32                      value,
709                                                            GFileQueryInfoFlags         flags,
710                                                            GCancellable               *cancellable,
711                                                            GError                    **error);
712 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
713                                                            const char                 *attribute,
714                                                            guint64                     value,
715                                                            GFileQueryInfoFlags         flags,
716                                                            GCancellable               *cancellable,
717                                                            GError                    **error);
718 gboolean                g_file_set_attribute_int64        (GFile                      *file,
719                                                            const char                 *attribute,
720                                                            gint64                      value,
721                                                            GFileQueryInfoFlags         flags,
722                                                            GCancellable               *cancellable,
723                                                            GError                    **error);
724 void                    g_mount_for_location              (GFile                      *location,
725                                                            GMountOperation            *mount_operation,
726                                                            GCancellable               *cancellable,
727                                                            GAsyncReadyCallback         callback,
728                                                            gpointer                    user_data);
729 gboolean                g_mount_for_location_finish       (GFile                      *location,
730                                                            GAsyncResult               *result,
731                                                            GError                    **error);
732 void                    g_file_mount_mountable            (GFile                      *file,
733                                                            GMountOperation            *mount_operation,
734                                                            GCancellable               *cancellable,
735                                                            GAsyncReadyCallback         callback,
736                                                            gpointer                    user_data);
737 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
738                                                            GAsyncResult               *result,
739                                                            GError                    **error);
740 void                    g_file_unmount_mountable          (GFile                      *file,
741                                                            GCancellable               *cancellable,
742                                                            GAsyncReadyCallback         callback,
743                                                            gpointer                    user_data);
744 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
745                                                            GAsyncResult               *result,
746                                                            GError                    **error);
747 void                    g_file_eject_mountable            (GFile                      *file,
748                                                            GCancellable               *cancellable,
749                                                            GAsyncReadyCallback         callback,
750                                                            gpointer                    user_data);
751 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
752                                                            GAsyncResult               *result,
753                                                            GError                    **error);
754
755 gboolean                g_file_copy_attributes            (GFile                      *source,
756                                                            GFile                      *destination,
757                                                            GFileCopyFlags              flags,
758                                                            GCancellable               *cancellable,
759                                                            GError                    **error);
760
761
762 GDirectoryMonitor* g_file_monitor_directory          (GFile                  *file,
763                                                       GFileMonitorFlags       flags,
764                                                       GCancellable           *cancellable);
765 GFileMonitor*      g_file_monitor_file               (GFile                  *file,
766                                                       GFileMonitorFlags       flags,
767                                                       GCancellable           *cancellable);
768
769
770 /* Utilities */
771
772 gboolean g_file_load_contents                (GFile                  *file,
773                                               GCancellable           *cancellable,
774                                               char                  **contents,
775                                               gsize                  *length,
776                                               char                  **etag_out,
777                                               GError                **error);
778 void     g_file_load_contents_async          (GFile                  *file,
779                                               GCancellable           *cancellable,
780                                               GAsyncReadyCallback     callback,
781                                               gpointer                user_data);
782 gboolean g_file_load_contents_finish         (GFile                  *file,
783                                               GAsyncResult           *res,
784                                               char                  **contents,
785                                               gsize                  *length,
786                                               char                  **etag_out,
787                                               GError                **error);
788 void     g_file_load_partial_contents_async  (GFile                  *file,
789                                               GCancellable           *cancellable,
790                                               GFileReadMoreCallback   read_more_callback,
791                                               GAsyncReadyCallback     callback,
792                                               gpointer                user_data);
793 gboolean g_file_load_partial_contents_finish (GFile                  *file,
794                                               GAsyncResult           *res,
795                                               char                  **contents,
796                                               gsize                  *length,
797                                               char                  **etag_out,
798                                               GError                **error);
799 gboolean g_file_replace_contents             (GFile                  *file,
800                                               const char             *contents,
801                                               gsize                   length,
802                                               const char             *etag,
803                                               gboolean                make_backup,
804                                               GFileCreateFlags        flags,
805                                               char                  **new_etag,
806                                               GCancellable           *cancellable,
807                                               GError                **error);
808 void     g_file_replace_contents_async       (GFile                  *file,
809                                               const char             *contents,
810                                               gsize                   length,
811                                               const char             *etag,
812                                               gboolean                make_backup,
813                                               GFileCreateFlags        flags,
814                                               GCancellable           *cancellable,
815                                               GAsyncReadyCallback     callback,
816                                               gpointer                user_data);
817 gboolean g_file_replace_contents_finish      (GFile                  *file,
818                                               GAsyncResult           *res,
819                                               char                  **new_etag,
820                                               GError                **error);
821
822 G_END_DECLS
823
824 #endif /* __G_FILE_H__ */