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