gio/ docs/reference/gio Merged gio-standalone into glib.
[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 typedef enum {
41   G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS = (1<<0)
42 } GFileQueryInfoFlags;
43
44 typedef enum  {
45   G_FILE_CREATE_FLAGS_NONE = 0,
46   G_FILE_CREATE_FLAGS_PRIVATE = (1<<0)
47 } GFileCreateFlags;
48
49 typedef enum {
50   G_FILE_COPY_OVERWRITE = (1<<0),
51   G_FILE_COPY_BACKUP = (1<<1),
52   G_FILE_COPY_NOFOLLOW_SYMLINKS = (1<<2),
53   G_FILE_COPY_ALL_METADATA = (1<<3)
54 } GFileCopyFlags;
55
56 typedef enum  {
57   G_FILE_MONITOR_FLAGS_NONE = 0,
58   G_FILE_MONITOR_FLAGS_MONITOR_MOUNTS = (1<<0)
59 } GFileMonitorFlags;
60
61 typedef struct _GFile                   GFile; /* Dummy typedef */
62 typedef struct _GFileIface              GFileIface;
63 typedef struct _GDirectoryMonitor       GDirectoryMonitor;
64 typedef struct _GFileMonitor            GFileMonitor;
65 typedef struct _GVolume         GVolume; /* Dummy typedef */
66
67 typedef void (*GFileProgressCallback) (goffset current_num_bytes,
68                                        goffset total_num_bytes,
69                                        gpointer user_data);
70 typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
71                                             goffset file_size,
72                                             gpointer callback_data);
73
74
75 struct _GFileIface
76 {
77   GTypeInterface g_iface;
78
79   /* Virtual Table */
80
81   GFile *             (*dup)                        (GFile         *file);
82   guint               (*hash)                       (GFile         *file);
83   gboolean            (*equal)                      (GFile         *file1,
84                                                      GFile         *file2);
85   gboolean            (*is_native)                  (GFile         *file);
86   gboolean            (*has_uri_scheme)             (GFile         *file,
87                                                      const char    *uri_scheme);
88   char *              (*get_uri_scheme)             (GFile         *file);
89   char *              (*get_basename)               (GFile         *file);
90   char *              (*get_path)                   (GFile         *file);
91   char *              (*get_uri)                    (GFile         *file);
92   char *              (*get_parse_name)             (GFile         *file);
93   GFile *             (*get_parent)                 (GFile         *file);
94   gboolean            (*contains_file)              (GFile         *parent,
95                                                      GFile         *descendant);
96   char *              (*get_relative_path)          (GFile         *parent,
97                                                      GFile         *descendant);
98   GFile *             (*resolve_relative_path)      (GFile        *file,
99                                                      const char   *relative_path);
100   GFile *             (*get_child_for_display_name) (GFile        *file,
101                                                      const char   *display_name,
102                                                      GError      **error);
103   
104   GFileEnumerator *   (*enumerate_children)        (GFile                *file,
105                                                     const char           *attributes,
106                                                     GFileQueryInfoFlags   flags,
107                                                     GCancellable         *cancellable,
108                                                     GError              **error);
109   void                (*enumerate_children_async)  (GFile                      *file,
110                                                     const char                 *attributes,
111                                                     GFileQueryInfoFlags         flags,
112                                                     int                         io_priority,
113                                                     GCancellable               *cancellable,
114                                                     GAsyncReadyCallback         callback,
115                                                     gpointer                    user_data);
116   GFileEnumerator *   (*enumerate_children_finish) (GFile                      *file,
117                                                     GAsyncResult               *res,
118                                                     GError                    **error);
119   
120   GFileInfo *         (*query_info)         (GFile                *file,
121                                              const char           *attributes,
122                                              GFileQueryInfoFlags   flags,
123                                              GCancellable         *cancellable,
124                                              GError              **error);
125   void                (*query_info_async)   (GFile                *file,
126                                              const char           *attributes,
127                                              GFileQueryInfoFlags   flags,
128                                              int                   io_priority,
129                                              GCancellable         *cancellable,
130                                              GAsyncReadyCallback   callback,
131                                              gpointer              user_data);
132   GFileInfo *         (*query_info_finish)  (GFile                *file,
133                                              GAsyncResult         *res,
134                                              GError              **error);
135   
136   GFileInfo *         (*query_filesystem_info)(GFile                *file,
137                                              const char           *attributes,
138                                              GCancellable         *cancellable,
139                                              GError              **error);
140   void                (*_query_filesystem_info_async) (void);
141   void                (*_query_filesystem_info_finish) (void);
142   
143   GVolume *           (*find_enclosing_volume)(GFile              *file,
144                                                GCancellable       *cancellable,
145                                                GError            **error);
146   void                (*find_enclosing_volume_async)(GFile              *file,
147                                                      int                   io_priority,
148                                                      GCancellable         *cancellable,
149                                                      GAsyncReadyCallback   callback,
150                                                      gpointer              user_data);
151   GVolume *           (*find_enclosing_volume_finish)(GFile              *file,
152                                                       GAsyncResult         *res,
153                                                       GError            **error);
154   
155   GFile *             (*set_display_name)         (GFile                *file,
156                                                    const char           *display_name,
157                                                    GCancellable         *cancellable,
158                                                    GError              **error);
159   void                (*set_display_name_async)   (GFile                      *file,
160                                                    const char                 *display_name,
161                                                    int                         io_priority,
162                                                    GCancellable               *cancellable,
163                                                    GAsyncReadyCallback         callback,
164                                                    gpointer                    user_data);
165   GFile *              (*set_display_name_finish) (GFile                      *file,
166                                                    GAsyncResult               *res,
167                                                    GError                    **error);
168   
169   GFileAttributeInfoList * (*query_settable_attributes) (GFile        *file,
170                                                          GCancellable *cancellable,
171                                                          GError      **error);
172   void                (*_query_settable_attributes_async) (void);
173   void                (*_query_settable_attributes_finish) (void);
174   
175   GFileAttributeInfoList * (*query_writable_namespaces) (GFile        *file,
176                                                          GCancellable *cancellable,
177                                                          GError      **error);
178   void                (*_query_writable_namespaces_async) (void);
179   void                (*_query_writable_namespaces_finish) (void);
180   
181   gboolean            (*set_attribute)            (GFile                *file,
182                                                    const char           *attribute,
183                                                    const GFileAttributeValue *value,
184                                                    GFileQueryInfoFlags   flags,
185                                                    GCancellable         *cancellable,
186                                                    GError              **error);
187   gboolean            (*set_attributes_from_info) (GFile          *file,
188                                                    GFileInfo            *info,
189                                                    GFileQueryInfoFlags   flags,
190                                                    GCancellable         *cancellable,
191                                                    GError              **error);
192   void                (*set_attributes_async)     (GFile                      *file,
193                                                    GFileInfo                  *info,
194                                                    GFileQueryInfoFlags        flags,
195                                                    int                         io_priority,
196                                                    GCancellable               *cancellable,
197                                                    GAsyncReadyCallback         callback,
198                                                    gpointer                    user_data);
199   gboolean            (*set_attributes_finish)    (GFile                      *file,
200                                                    GAsyncResult               *result,
201                                                    GFileInfo                 **info,
202                                                    GError                    **error);
203   
204   GFileInputStream *  (*read)               (GFile                *file,
205                                              GCancellable         *cancellable,
206                                              GError              **error);
207   void                (*read_async)         (GFile                *file,
208                                              int                   io_priority,
209                                              GCancellable         *cancellable,
210                                              GAsyncReadyCallback   callback,
211                                              gpointer              user_data);
212   GFileInputStream *  (*read_finish)        (GFile                *file,
213                                              GAsyncResult         *res,
214                                              GError              **error);
215   
216   GFileOutputStream * (*append_to)          (GFile                *file,
217                                              GFileCreateFlags      flags,
218                                              GCancellable         *cancellable,
219                                              GError               **error);
220   void                 (*append_to_async)   (GFile                      *file,
221                                              GFileCreateFlags            flags,
222                                              int                         io_priority,
223                                              GCancellable               *cancellable,
224                                              GAsyncReadyCallback         callback,
225                                              gpointer                    user_data);
226   GFileOutputStream *  (*append_to_finish)  (GFile                      *file,
227                                              GAsyncResult               *res,
228                                              GError                    **error);
229   
230   GFileOutputStream * (*create)             (GFile                *file,
231                                              GFileCreateFlags      flags,
232                                              GCancellable         *cancellable,
233                                              GError               **error);
234   void                 (*create_async)      (GFile                      *file,
235                                              GFileCreateFlags            flags,
236                                              int                         io_priority,
237                                              GCancellable               *cancellable,
238                                              GAsyncReadyCallback         callback,
239                                              gpointer                    user_data);
240   GFileOutputStream *  (*create_finish)     (GFile                      *file,
241                                              GAsyncResult               *res,
242                                              GError                    **error);
243   
244   GFileOutputStream *  (*replace)           (GFile                *file,
245                                              const char           *etag,
246                                              gboolean              make_backup,
247                                              GFileCreateFlags      flags,
248                                              GCancellable         *cancellable,
249                                              GError              **error);
250   void                 (*replace_async)     (GFile                      *file,
251                                              const char                 *etag,
252                                              gboolean                    make_backup,
253                                              GFileCreateFlags            flags,
254                                              int                         io_priority,
255                                              GCancellable               *cancellable,
256                                              GAsyncReadyCallback         callback,
257                                              gpointer                    user_data);
258   GFileOutputStream *  (*replace_finish)    (GFile                      *file,
259                                              GAsyncResult               *res,
260                                              GError                    **error);
261   
262   gboolean            (*delete_file)        (GFile                *file,
263                                              GCancellable         *cancellable,
264                                              GError              **error);
265   void                (*_delete_file_async) (void);
266   void                (*_delete_file_finish) (void);
267   
268   gboolean            (*trash)              (GFile                *file,
269                                              GCancellable         *cancellable,
270                                              GError              **error);
271   void                (*_trash_async) (void);
272   void                (*_trash_finish) (void);
273   
274   gboolean            (*make_directory)     (GFile                *file,
275                                              GCancellable         *cancellable,
276                                              GError              **error);
277   void                (*_make_directory_async) (void);
278   void                (*_make_directory_finish) (void);
279   
280   gboolean            (*make_symbolic_link) (GFile                *file,
281                                              const char           *symlink_value,
282                                              GCancellable         *cancellable,
283                                              GError              **error);
284   void                (*_make_symbolic_link_async) (void);
285   void                (*_make_symbolic_link_finish) (void);
286   
287   gboolean            (*copy)               (GFile                *source,
288                                              GFile                *destination,
289                                              GFileCopyFlags        flags,
290                                              GCancellable         *cancellable,
291                                              GFileProgressCallback progress_callback,
292                                              gpointer              progress_callback_data,
293                                              GError              **error);
294   void                (*_copy_async) (void);
295   void                (*_copy_finish) (void);
296   
297   gboolean            (*move)               (GFile                *source,
298                                              GFile                *destination,
299                                              GFileCopyFlags        flags,
300                                              GCancellable         *cancellable,
301                                              GFileProgressCallback progress_callback,
302                                              gpointer              progress_callback_data,
303                                              GError              **error);
304
305   void                (*_move_async) (void);
306   void                (*_move_finish) (void);
307
308
309   void                (*mount_mountable)           (GFile               *file,
310                                                     GMountOperation     *mount_operation,
311                                                     GCancellable         *cancellable,
312                                                     GAsyncReadyCallback  callback,
313                                                     gpointer             user_data);
314   GFile *             (*mount_mountable_finish)    (GFile               *file,
315                                                     GAsyncResult        *result,
316                                                     GError             **error);
317   void                (*unmount_mountable)         (GFile               *file,
318                                                     GCancellable         *cancellable,
319                                                     GAsyncReadyCallback  callback,
320                                                     gpointer             user_data);
321   gboolean            (*unmount_mountable_finish)  (GFile               *file,
322                                                     GAsyncResult        *result,
323                                                     GError             **error);
324   void                (*eject_mountable)           (GFile               *file,
325                                                     GCancellable        *cancellable,
326                                                     GAsyncReadyCallback  callback,
327                                                     gpointer             user_data);
328   gboolean            (*eject_mountable_finish)    (GFile               *file,
329                                                     GAsyncResult        *result,
330                                                     GError             **error);
331
332
333   void     (*mount_for_location)        (GFile *location,
334                                          GMountOperation *mount_operation,
335                                          GCancellable *cancellable,
336                                          GAsyncReadyCallback callback,
337                                          gpointer user_data);
338   gboolean (*mount_for_location_finish) (GFile *location,
339                                          GAsyncResult *result,
340                                          GError **error);
341   
342   GDirectoryMonitor* (*monitor_dir)         (GFile                  *file,
343                                              GFileMonitorFlags       flags,
344                                              GCancellable           *cancellable);
345
346   GFileMonitor*      (*monitor_file)        (GFile                  *file,
347                                              GFileMonitorFlags       flags,
348                                              GCancellable           *cancellable);
349 };
350
351 GType g_file_get_type (void) G_GNUC_CONST;
352
353 GFile *                 g_file_new_for_path               (const char                 *path);
354 GFile *                 g_file_new_for_uri                (const char                 *uri);
355 GFile *                 g_file_new_for_commandline_arg    (const char                 *arg);
356 GFile *                 g_file_parse_name                 (const char                 *parse_name);
357 GFile *                 g_file_dup                        (GFile                      *file);
358 guint                   g_file_hash                       (gconstpointer               file);
359 gboolean                g_file_equal                      (GFile                      *file1,
360                                                            GFile                      *file2);
361 char *                  g_file_get_basename               (GFile                      *file);
362 char *                  g_file_get_path                   (GFile                      *file);
363 char *                  g_file_get_uri                    (GFile                      *file);
364 char *                  g_file_get_parse_name             (GFile                      *file);
365 GFile *                 g_file_get_parent                 (GFile                      *file);
366 GFile *                 g_file_get_child                  (GFile                      *file,
367                                                            const char                 *name);
368 GFile *                 g_file_get_child_for_display_name (GFile                      *file,
369                                                            const char                 *display_name,
370                                                            GError                    **error);
371 gboolean                g_file_contains_file              (GFile                      *parent,
372                                                            GFile                      *descendant);
373 char *                  g_file_get_relative_path          (GFile                      *parent,
374                                                            GFile                      *descendant);
375 GFile *                 g_file_resolve_relative_path      (GFile                      *file,
376                                                            const char                 *relative_path);
377 gboolean                g_file_is_native                  (GFile                      *file);
378 gboolean                g_file_has_uri_scheme             (GFile                      *file,
379                                                            const char                 *uri_scheme);
380 char *                  g_file_get_uri_scheme             (GFile                      *file);
381 GFileInputStream *      g_file_read                       (GFile                      *file,
382                                                            GCancellable               *cancellable,
383                                                            GError                    **error);
384 void                    g_file_read_async                 (GFile                      *file,
385                                                            int                         io_priority,
386                                                            GCancellable               *cancellable,
387                                                            GAsyncReadyCallback         callback,
388                                                            gpointer                    user_data);
389 GFileInputStream *      g_file_read_finish                (GFile                      *file,
390                                                            GAsyncResult               *res,
391                                                            GError                    **error);
392 GFileOutputStream *     g_file_append_to                  (GFile                      *file,
393                                                            GFileCreateFlags             flags,
394                                                            GCancellable               *cancellable,
395                                                            GError                    **error);
396 GFileOutputStream *     g_file_create                     (GFile                      *file,
397                                                            GFileCreateFlags             flags,
398                                                            GCancellable               *cancellable,
399                                                            GError                    **error);
400 GFileOutputStream *     g_file_replace                    (GFile                      *file,
401                                                            const char                 *etag,
402                                                            gboolean                    make_backup,
403                                                            GFileCreateFlags            flags,
404                                                            GCancellable               *cancellable,
405                                                            GError                    **error);
406 void                    g_file_append_to_async            (GFile                      *file,
407                                                            GFileCreateFlags            flags,
408                                                            int                         io_priority,
409                                                            GCancellable               *cancellable,
410                                                            GAsyncReadyCallback         callback,
411                                                            gpointer                    user_data);
412 GFileOutputStream *     g_file_append_to_finish           (GFile                      *file,
413                                                            GAsyncResult               *res,
414                                                            GError                    **error);
415 void                    g_file_create_async               (GFile                      *file,
416                                                            GFileCreateFlags            flags,
417                                                            int                         io_priority,
418                                                            GCancellable               *cancellable,
419                                                            GAsyncReadyCallback         callback,
420                                                            gpointer                    user_data);
421 GFileOutputStream *     g_file_create_finish              (GFile                      *file,
422                                                            GAsyncResult               *res,
423                                                            GError                    **error);
424 void                    g_file_replace_async              (GFile                      *file,
425                                                            const char                 *etag,
426                                                            gboolean                    make_backup,
427                                                            GFileCreateFlags            flags,
428                                                            int                         io_priority,
429                                                            GCancellable               *cancellable,
430                                                            GAsyncReadyCallback         callback,
431                                                            gpointer                    user_data);
432 GFileOutputStream *     g_file_replace_finish             (GFile                      *file,
433                                                            GAsyncResult               *res,
434                                                            GError                    **error);
435 GFileInfo *             g_file_query_info                 (GFile                      *file,
436                                                            const char                 *attributes,
437                                                            GFileQueryInfoFlags         flags,
438                                                            GCancellable               *cancellable,
439                                                            GError                    **error);
440 void                    g_file_query_info_async           (GFile                      *file,
441                                                            const char                 *attributes,
442                                                            GFileQueryInfoFlags         flags,
443                                                            int                         io_priority,
444                                                            GCancellable               *cancellable,
445                                                            GAsyncReadyCallback         callback,
446                                                            gpointer                    user_data);
447 GFileInfo *             g_file_query_info_finish          (GFile                      *file,
448                                                            GAsyncResult               *res,
449                                                            GError                    **error);
450 GFileInfo *             g_file_query_filesystem_info      (GFile                      *file,
451                                                            const char                 *attributes,
452                                                            GCancellable               *cancellable,
453                                                            GError                    **error);
454 GVolume *               g_file_find_enclosing_volume      (GFile                      *file,
455                                                            GCancellable               *cancellable,
456                                                            GError                    **error);
457 GFileEnumerator *       g_file_enumerate_children         (GFile                      *file,
458                                                            const char                 *attributes,
459                                                            GFileQueryInfoFlags         flags,
460                                                            GCancellable               *cancellable,
461                                                            GError                    **error);
462 void                    g_file_enumerate_children_async   (GFile                      *file,
463                                                            const char                 *attributes,
464                                                            GFileQueryInfoFlags         flags,
465                                                            int                         io_priority,
466                                                            GCancellable               *cancellable,
467                                                            GAsyncReadyCallback         callback,
468                                                            gpointer                    user_data);
469 GFileEnumerator *       g_file_enumerate_children_finish  (GFile                      *file,
470                                                            GAsyncResult               *res,
471                                                            GError                    **error);
472 GFile *                 g_file_set_display_name           (GFile                      *file,
473                                                            const char                 *display_name,
474                                                            GCancellable               *cancellable,
475                                                            GError                    **error);
476 void                    g_file_set_display_name_async     (GFile                      *file,
477                                                            const char                 *display_name,
478                                                            int                         io_priority,
479                                                            GCancellable               *cancellable,
480                                                            GAsyncReadyCallback         callback,
481                                                            gpointer                    user_data);
482 GFile *                 g_file_set_display_name_finish    (GFile                      *file,
483                                                            GAsyncResult               *res,
484                                                            GError                    **error);
485 gboolean                g_file_delete                     (GFile                      *file,
486                                                            GCancellable               *cancellable,
487                                                            GError                    **error);
488 gboolean                g_file_trash                      (GFile                      *file,
489                                                            GCancellable               *cancellable,
490                                                            GError                    **error);
491 gboolean                g_file_copy                       (GFile                      *source,
492                                                            GFile                      *destination,
493                                                            GFileCopyFlags              flags,
494                                                            GCancellable               *cancellable,
495                                                            GFileProgressCallback       progress_callback,
496                                                            gpointer                    progress_callback_data,
497                                                            GError                    **error);
498 gboolean                g_file_move                       (GFile                      *source,
499                                                            GFile                      *destination,
500                                                            GFileCopyFlags              flags,
501                                                            GCancellable               *cancellable,
502                                                            GFileProgressCallback       progress_callback,
503                                                            gpointer                    progress_callback_data,
504                                                            GError                    **error);
505 gboolean                g_file_make_directory             (GFile                      *file,
506                                                            GCancellable               *cancellable,
507                                                            GError                    **error);
508 gboolean                g_file_make_symbolic_link         (GFile                      *file,
509                                                            const char                 *symlink_value,
510                                                            GCancellable               *cancellable,
511                                                            GError                    **error);
512 GFileAttributeInfoList *g_file_query_settable_attributes  (GFile                      *file,
513                                                            GCancellable               *cancellable,
514                                                            GError                    **error);
515 GFileAttributeInfoList *g_file_query_writable_namespaces  (GFile                      *file,
516                                                            GCancellable               *cancellable,
517                                                            GError                    **error);
518 gboolean                g_file_set_attribute              (GFile                      *file,
519                                                            const char                 *attribute,
520                                                            const GFileAttributeValue  *value,
521                                                            GFileQueryInfoFlags         flags,
522                                                            GCancellable               *cancellable,
523                                                            GError                    **error);
524 gboolean                g_file_set_attributes_from_info   (GFile                      *file,
525                                                            GFileInfo                  *info,
526                                                            GFileQueryInfoFlags         flags,
527                                                            GCancellable               *cancellable,
528                                                            GError                    **error);
529 void                    g_file_set_attributes_async       (GFile                      *file,
530                                                            GFileInfo                  *info,
531                                                            GFileQueryInfoFlags         flags,
532                                                            int                         io_priority,
533                                                            GCancellable               *cancellable,
534                                                            GAsyncReadyCallback         callback,
535                                                            gpointer                    user_data);
536 gboolean                g_file_set_attributes_finish      (GFile                      *file,
537                                                            GAsyncResult               *result,
538                                                            GFileInfo                 **info,
539                                                            GError                    **error);
540 gboolean                g_file_set_attribute_string       (GFile                      *file,
541                                                            const char                 *attribute,
542                                                            const char                 *value,
543                                                            GFileQueryInfoFlags         flags,
544                                                            GCancellable               *cancellable,
545                                                            GError                    **error);
546 gboolean                g_file_set_attribute_byte_string  (GFile                      *file,
547                                                            const char                 *attribute,
548                                                            const char                 *value,
549                                                            GFileQueryInfoFlags         flags,
550                                                            GCancellable               *cancellable,
551                                                            GError                    **error);
552 gboolean                g_file_set_attribute_uint32       (GFile                      *file,
553                                                            const char                 *attribute,
554                                                            guint32                     value,
555                                                            GFileQueryInfoFlags         flags,
556                                                            GCancellable               *cancellable,
557                                                            GError                    **error);
558 gboolean                g_file_set_attribute_int32        (GFile                      *file,
559                                                            const char                 *attribute,
560                                                            gint32                      value,
561                                                            GFileQueryInfoFlags         flags,
562                                                            GCancellable               *cancellable,
563                                                            GError                    **error);
564 gboolean                g_file_set_attribute_uint64       (GFile                      *file,
565                                                            const char                 *attribute,
566                                                            guint64                     value,
567                                                            GFileQueryInfoFlags         flags,
568                                                            GCancellable               *cancellable,
569                                                            GError                    **error);
570 gboolean                g_file_set_attribute_int64        (GFile                      *file,
571                                                            const char                 *attribute,
572                                                            gint64                      value,
573                                                            GFileQueryInfoFlags         flags,
574                                                            GCancellable               *cancellable,
575                                                            GError                    **error);
576 void                    g_mount_for_location              (GFile                      *location,
577                                                            GMountOperation            *mount_operation,
578                                                            GCancellable               *cancellable,
579                                                            GAsyncReadyCallback         callback,
580                                                            gpointer                    user_data);
581 gboolean                g_mount_for_location_finish       (GFile                      *location,
582                                                            GAsyncResult               *result,
583                                                            GError                    **error);
584 void                    g_file_mount_mountable            (GFile                      *file,
585                                                            GMountOperation            *mount_operation,
586                                                            GCancellable               *cancellable,
587                                                            GAsyncReadyCallback         callback,
588                                                            gpointer                    user_data);
589 GFile *                 g_file_mount_mountable_finish     (GFile                      *file,
590                                                            GAsyncResult               *result,
591                                                            GError                    **error);
592 void                    g_file_unmount_mountable          (GFile                      *file,
593                                                            GCancellable               *cancellable,
594                                                            GAsyncReadyCallback         callback,
595                                                            gpointer                    user_data);
596 gboolean                g_file_unmount_mountable_finish   (GFile                      *file,
597                                                            GAsyncResult               *result,
598                                                            GError                    **error);
599 void                    g_file_eject_mountable            (GFile                      *file,
600                                                            GCancellable               *cancellable,
601                                                            GAsyncReadyCallback         callback,
602                                                            gpointer                    user_data);
603 gboolean                g_file_eject_mountable_finish     (GFile                      *file,
604                                                            GAsyncResult               *result,
605                                                            GError                    **error);
606
607 gboolean                g_file_copy_attributes            (GFile                      *source,
608                                                            GFile                      *destination,
609                                                            GFileCopyFlags              flags,
610                                                            GCancellable               *cancellable,
611                                                            GError                    **error);
612
613
614 GDirectoryMonitor* g_file_monitor_directory          (GFile                  *file,
615                                                       GFileMonitorFlags       flags,
616                                                       GCancellable           *cancellable);
617 GFileMonitor*      g_file_monitor_file               (GFile                  *file,
618                                                       GFileMonitorFlags       flags,
619                                                       GCancellable           *cancellable);
620
621
622 /* Utilities */
623
624 gboolean g_file_load_contents                (GFile                  *file,
625                                               GCancellable           *cancellable,
626                                               char                  **contents,
627                                               gsize                  *length,
628                                               char                  **etag_out,
629                                               GError                **error);
630 void     g_file_load_contents_async          (GFile                  *file,
631                                               GCancellable           *cancellable,
632                                               GAsyncReadyCallback     callback,
633                                               gpointer                user_data);
634 gboolean g_file_load_contents_finish         (GFile                  *file,
635                                               GAsyncResult           *res,
636                                               char                  **contents,
637                                               gsize                  *length,
638                                               char                  **etag_out,
639                                               GError                **error);
640 void     g_file_load_partial_contents_async  (GFile                  *file,
641                                               GCancellable           *cancellable,
642                                               GFileReadMoreCallback   read_more_callback,
643                                               GAsyncReadyCallback     callback,
644                                               gpointer                user_data);
645 gboolean g_file_load_partial_contents_finish (GFile                  *file,
646                                               GAsyncResult           *res,
647                                               char                  **contents,
648                                               gsize                  *length,
649                                               char                  **etag_out,
650                                               GError                **error);
651 gboolean g_file_replace_contents             (GFile                  *file,
652                                               const char             *contents,
653                                               gsize                   length,
654                                               const char             *etag,
655                                               gboolean                make_backup,
656                                               GFileCreateFlags        flags,
657                                               char                  **new_etag,
658                                               GCancellable           *cancellable,
659                                               GError                **error);
660 void     g_file_replace_contents_async       (GFile                  *file,
661                                               const char             *contents,
662                                               gsize                   length,
663                                               const char             *etag,
664                                               gboolean                make_backup,
665                                               GFileCreateFlags        flags,
666                                               GCancellable           *cancellable,
667                                               GAsyncReadyCallback     callback,
668                                               gpointer                user_data);
669 gboolean g_file_replace_contents_finish      (GFile                  *file,
670                                               GAsyncResult           *res,
671                                               char                  **new_etag,
672                                               GError                **error);
673
674 G_END_DECLS
675
676 #endif /* __G_FILE_H__ */