1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
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.
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.
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.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
27 #ifndef __G_FILE_INFO_H__
28 #define __G_FILE_INFO_H__
30 #include <glib-object.h>
31 #include <glib/gfileutils.h>
32 #include <gio/gfileattribute.h>
33 #include <gio/gicon.h>
37 #define G_TYPE_FILE_INFO (g_file_info_get_type ())
38 #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
39 #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
40 #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
41 #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
42 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
47 * Stores information about a file system object referenced by a #GFile.
49 typedef struct _GFileInfo GFileInfo;
50 typedef struct _GFileInfoClass GFileInfoClass;
53 * GFileAttributeMatcher:
55 * Determines if a string matches a file attribute.
57 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
61 * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
62 * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
63 * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
64 * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link
66 * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo,
67 * block device, or character device.
68 * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems).
69 * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
71 * Indicates the file's on-disk type.
74 G_FILE_TYPE_UNKNOWN = 0,
76 G_FILE_TYPE_DIRECTORY,
77 G_FILE_TYPE_SYMBOLIC_LINK,
78 G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
83 /* Common Attributes: */
85 * G_FILE_ATTRIBUTE_STD_TYPE:
87 * A key in the "std" namespace for storing file types.
88 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
89 * The value for this key should contain a #GFileType.
91 #define G_FILE_ATTRIBUTE_STD_TYPE "std::type" /* uint32 (GFileType) */
94 * G_FILE_ATTRIBUTE_STD_IS_HIDDEN:
96 * A key in the "std" namespace for checking if a file is hidden.
97 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
99 #define G_FILE_ATTRIBUTE_STD_IS_HIDDEN "std::is-hidden" /* boolean */
102 * G_FILE_ATTRIBUTE_STD_IS_BACKUP:
104 * A key in the "std" namespace for checking if a file is a backup file.
105 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
107 #define G_FILE_ATTRIBUTE_STD_IS_BACKUP "std::is-backup" /* boolean */
110 * G_FILE_ATTRIBUTE_STD_IS_SYMLINK:
112 * A key in the "std" namespace for checking if the file is a symlink.
113 * Typically the actual type is something else, if we followed the symlink
115 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
117 #define G_FILE_ATTRIBUTE_STD_IS_SYMLINK "std::is-symlink" /* boolean */
120 * G_FILE_ATTRIBUTE_STD_IS_VIRTUAL:
122 * A key in the "std" namespace for checking if a file is virtual.
123 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
125 #define G_FILE_ATTRIBUTE_STD_IS_VIRTUAL "std::is-virtual" /* boolean */
128 * G_FILE_ATTRIBUTE_STD_NAME:
130 * A key in the "std" namespace for getting the name of the file.
131 * The name is the on-disk filename which may not be in any known encoding,
132 * and can thus not be generally displayed as is.
133 * Use #G_FILE_ATTRIBUTE_STD_DISPLAY_NAME if you need to display the
134 * name in a user interface.
135 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
137 #define G_FILE_ATTRIBUTE_STD_NAME "std::name" /* byte string */
140 * G_FILE_ATTRIBUTE_STD_DISPLAY_NAME:
142 * A key in the "std" namespace for getting the display name of the file.
143 * A display name is guaranteed to be in UTF8 and can thus be displayed in
145 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
147 #define G_FILE_ATTRIBUTE_STD_DISPLAY_NAME "std::display-name" /* string */
150 * G_FILE_ATTRIBUTE_STD_EDIT_NAME:
152 * A key in the "std" namespace for edit name of the file.
153 * An edit name is similar to the display name, but it is meant to be
154 * used when you want to rename the file in the UI. The display name
155 * might contain information you don't want in the new filename (such as
156 * "(invalid unicode)" if the filename was in an invalid encoding).
158 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
160 #define G_FILE_ATTRIBUTE_STD_EDIT_NAME "std::edit-name" /* string */
163 * G_FILE_ATTRIBUTE_STD_COPY_NAME:
165 * A key in the "std" namespace for getting the copy name of the file.
166 * The copy name is an optional version of the name. If availible its always
167 * in UTF8, and corresponds directly to the original filename (only transcoded to
168 * UTF8). This is useful if you want to copy the file to another filesystem that
169 * might have a different encoding. If the filename is not a valid string in the
170 * encoding selected for the filesystem it is in then the copy name will not be set.
172 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
174 #define G_FILE_ATTRIBUTE_STD_COPY_NAME "std::copy-name" /* string */
177 * G_FILE_ATTRIBUTE_STD_ICON:
179 * A key in the "std" namespace for getting the icon for the file.
180 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
181 * The value for this key should contain a #GIcon.
183 #define G_FILE_ATTRIBUTE_STD_ICON "std::icon" /* object (GIcon) */
186 * G_FILE_ATTRIBUTE_STD_CONTENT_TYPE:
188 * A key in the "std" namespace for getting the content type of the file.
189 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
190 * The value for this key should contain a valid content type.
192 #define G_FILE_ATTRIBUTE_STD_CONTENT_TYPE "std::content-type" /* string */
195 * G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE:
197 * A key in the "std" namespace for getting the fast content type.
198 * The fast content type isn't as reliable as the regular one, as it
199 * only uses the filename to guess it, but it is faster to calculate than the
200 * regular content type.
201 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
204 #define G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE "std::fast-content-type" /* string */
207 * G_FILE_ATTRIBUTE_STD_SIZE:
209 * A key in the "std" namespace for getting the file's size (in bytes).
210 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
212 #define G_FILE_ATTRIBUTE_STD_SIZE "std::size" /* uint64 */
215 * G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET:
217 * A key in the "std" namespace for getting the symlink target, if the file
218 * is a symlink. Corresponding #GFileAttributeType is
219 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
221 #define G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET "std::symlink-target" /* byte string */
224 * G_FILE_ATTRIBUTE_STD_TARGET_URI:
226 * A key in the "std" namespace for getting the target URI for the file, in
227 * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
228 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
230 #define G_FILE_ATTRIBUTE_STD_TARGET_URI "std::target-uri" /* string */
233 * G_FILE_ATTRIBUTE_STD_SORT_ORDER:
235 * A key in the "std" namespace for setting the sort order of a file.
236 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
237 * An example use would be in file managers, which would use this key
238 * to set the order files are displayed. Files with smaller sort order
239 * should be sorted first, and files without sort order as if sort order
242 #define G_FILE_ATTRIBUTE_STD_SORT_ORDER "std::sort-order" /* int32 */
244 /* Entity tags, used to avoid missing updates on save */
247 * G_FILE_ATTRIBUTE_ETAG_VALUE:
249 * A key in the "etag" namespace for getting the value of the file's
250 * entity tag. Corresponding #GFileAttributeType is
251 * %G_FILE_ATTRIBUTE_TYPE_STRING.
253 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
255 /* File identifier, for e.g. avoiding loops when doing recursive
260 * G_FILE_ATTRIBUTE_ID_FILE:
262 * A key in the "id" namespace for getting a file identifier.
263 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
264 * An example use would be during listing files, to avoid recursive
265 * directory scanning.
267 #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
270 * G_FILE_ATTRIBUTE_ID_FS:
272 * A key in the "id" namespace for getting the file system identifier.
273 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
274 * An example use would be during listing files, to avoid recursive
275 * directory scanning.
277 #define G_FILE_ATTRIBUTE_ID_FS "id::fs" /* string */
279 /* Calculated Access Rights for current user */
282 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
284 * A key in the "access" namespace for getting read privileges.
285 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
286 * This attribute will be %TRUE if the user is able to read the file.
288 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
291 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
293 * A key in the "access" namespace for getting write privileges.
294 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
295 * This attribute will be %TRUE if the user is able to write to the file.
297 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
300 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
302 * A key in the "access" namespace for getting execution privileges.
303 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
304 * This attribute will be %TRUE if the user is able to execute the file.
306 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
309 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
311 * A key in the "access" namespace for checking deletion privileges.
312 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
313 * This attribute will be %TRUE if the user is able to delete the file.
315 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
318 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
320 * A key in the "access" namespace for checking trashing privileges.
321 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
322 * This attribute will be %TRUE if the user is able to move the file to
325 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
328 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
330 * A key in the "access" namespace for checking renaming privileges.
331 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
332 * This attribute will be %TRUE if the user is able to rename the file.
334 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
336 /* TODO: Should we have special version for directories? can_enumerate, etc */
338 /* Mountable attributes */
341 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
343 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
344 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
346 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
349 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
351 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
352 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
354 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
357 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
359 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
360 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
362 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
365 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
367 * A key in the "mountable" namespace for getting the unix device.
368 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
370 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
373 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
375 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
376 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
378 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
380 /* Time attributes */
383 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
385 * A key in the "time" namespace for getting the time the file was last
386 * modified. Corresponding #GFileAttributeType is
387 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
390 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
393 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
395 * A key in the "time" namespace for getting the milliseconds of the time
396 * the file was last modified. This should be used in conjunction with
397 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
398 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
400 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
403 * G_FILE_ATTRIBUTE_TIME_ACCESS:
405 * A key in the "time" namespace for getting the time the file was last
406 * accessed. Corresponding #GFileAttributeType is
407 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
408 * file was last accessed.
410 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
413 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
415 * A key in the "time" namespace for getting the milliseconds of the time
416 * the file was last accessed. This should be used in conjunction with
417 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
418 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
420 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
423 * G_FILE_ATTRIBUTE_TIME_CHANGED:
425 * A key in the "time" namespace for getting the time the file was last
426 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
427 * and contains the UNIX time since the file was last changed.
429 * This corresponds to the traditional UNIX ctime.
431 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
434 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
436 * A key in the "time" namespace for getting the milliseconds of the time
437 * the file was last changed. This should be used in conjunction with
438 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
439 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
441 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
444 * G_FILE_ATTRIBUTE_TIME_CREATED:
446 * A key in the "time" namespace for getting the time the file was created.
447 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
448 * and contains the UNIX time since the file was created.
450 * This corresponds to the NTFS ctime.
452 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
455 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
457 * A key in the "time" namespace for getting the milliseconds of the time
458 * the file was created. This should be used in conjunction with
459 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
460 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
462 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
464 /* Unix specific attributes */
467 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
469 * A key in the "unix" namespace for getting the device id of the device the
470 * file is located on (see stat() documentation). This attribute is only
471 * available for UNIX file systems. Corresponding #GFileAttributeType is
472 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
474 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
477 * G_FILE_ATTRIBUTE_UNIX_INODE:
479 * A key in the "unix" namespace for getting the inode of the file.
480 * This attribute is only available for UNIX file systems. Corresponding
481 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
483 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
486 * G_FILE_ATTRIBUTE_UNIX_MODE:
488 * A key in the "unix" namespace for getting the mode of the file
489 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
490 * documentation. This attribute is only available for UNIX file systems.
491 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
493 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
496 * G_FILE_ATTRIBUTE_UNIX_NLINK:
498 * A key in the "unix" namespace for getting the number of hard links
499 * for a file. See lstat() documentation. This attribute is only available
500 * for UNIX file systems. Corresponding #GFileAttributeType is
501 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
503 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
506 * G_FILE_ATTRIBUTE_UNIX_UID:
508 * A key in the "unix" namespace for getting the user ID for the file.
509 * This attribute is only available for UNIX file systems.
510 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
512 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
515 * G_FILE_ATTRIBUTE_UNIX_GID:
517 * A key in the "unix" namespace for getting the group ID for the file.
518 * This attribute is only available for UNIX file systems.
519 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
521 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
524 * G_FILE_ATTRIBUTE_UNIX_RDEV:
526 * A key in the "unix" namespace for getting the device ID for the file
527 * (if it is a special file). See lstat() documentation. This attribute
528 * is only available for UNIX file systems. Corresponding #GFileAttributeType
529 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
531 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
534 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
536 * A key in the "unix" namespace for getting the block size for the file
537 * system. This attribute is only available for UNIX file systems.
538 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
540 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
543 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
545 * A key in the "unix" namespace for getting the number of blocks allocated
546 * for the file. This attribute is only available for UNIX file systems.
547 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
549 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
552 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
554 * A key in the "unix" namespace for checking if the file represents a
555 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
556 * point. This attribute is only available for UNIX file systems.
557 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
559 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
561 /* DOS specific attributes */
564 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
566 * A key in the "dos" namespace for checking if the file's archive flag
567 * is set. This attribute is %TRUE if the archive flag is set. This attribute
568 * is only available for DOS file systems. Corresponding #GFileAttributeType
569 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
571 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
574 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
576 * A key in the "dos" namespace for checking if the file's backup flag
577 * is set. This attribute is %TRUE if the backup flag is set. This attribute
578 * is only available for DOS file systems. Corresponding #GFileAttributeType
579 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
581 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
583 /* Owner attributes */
586 * G_FILE_ATTRIBUTE_OWNER_USER:
588 * A key in the "owner" namespace for getting the user name of the
589 * file's owner. Corresponding #GFileAttributeType is
590 * %G_FILE_ATTRIBUTE_TYPE_STRING.
592 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
595 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
597 * A key in the "owner" namespace for getting the real name of the
598 * user that owns the file. Corresponding #GFileAttributeType is
599 * %G_FILE_ATTRIBUTE_TYPE_STRING.
601 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
604 * G_FILE_ATTRIBUTE_OWNER_GROUP:
606 * A key in the "owner" namespace for getting the file owner's group.
607 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
609 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
614 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
616 * A key in the "thumbnail" namespace for getting the path to the thumbnail
617 * image. Corresponding #GFileAttributeType is
618 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
620 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
622 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
624 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
625 * This attribute is %TRUE if thumbnailing failed. Corresponding
626 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
628 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
630 /* File system info (for g_file_get_filesystem_info) */
633 * G_FILE_ATTRIBUTE_FS_SIZE:
635 * A key in the "fs" namespace for getting the total size (in bytes) of the file system,
636 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
637 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
639 #define G_FILE_ATTRIBUTE_FS_SIZE "fs::size" /* uint64 */
642 * G_FILE_ATTRIBUTE_FS_FREE:
644 * A key in the "fs" namespace for getting the number of bytes of free space left on the
645 * file system. Corresponding #GFileAttributeType is
646 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
648 #define G_FILE_ATTRIBUTE_FS_FREE "fs::free" /* uint64 */
651 * G_FILE_ATTRIBUTE_FS_TYPE:
653 * A key in the "fs" namespace for getting the file system's type.
654 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
656 #define G_FILE_ATTRIBUTE_FS_TYPE "fs::type" /* string */
659 * G_FILE_ATTRIBUTE_FS_READONLY:
661 * A key in the "fs" namespace for checking if the file system is read only.
662 * Is set to %TRUE if the file system is read only. Corresponding
663 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
665 #define G_FILE_ATTRIBUTE_FS_READONLY "fs::readonly" /* boolean */
668 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
670 * A key in the "gvfs" namespace that gets the name of the current
671 * GVFS backend in use. Corresponding #GFileAttributeType is
672 * %G_FILE_ATTRIBUTE_TYPE_STRING.
674 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
676 GType g_file_info_get_type (void) G_GNUC_CONST;
678 GFileInfo * g_file_info_new (void);
679 GFileInfo * g_file_info_dup (GFileInfo *other);
680 void g_file_info_copy_into (GFileInfo *src_info,
681 GFileInfo *dest_info);
682 gboolean g_file_info_has_attribute (GFileInfo *info,
683 const char *attribute);
684 char ** g_file_info_list_attributes (GFileInfo *info,
685 const char *name_space);
686 gboolean g_file_info_get_attribute_data (GFileInfo *info,
687 const char *attribute,
688 GFileAttributeType *type,
690 GFileAttributeStatus *status);
691 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
692 const char *attribute);
693 void g_file_info_remove_attribute (GFileInfo *info,
694 const char *attribute);
695 GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
696 const char *attribute);
697 char * g_file_info_get_attribute_as_string (GFileInfo *info,
698 const char *attribute);
699 const char * g_file_info_get_attribute_string (GFileInfo *info,
700 const char *attribute);
701 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
702 const char *attribute);
703 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
704 const char *attribute);
705 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
706 const char *attribute);
707 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
708 const char *attribute);
709 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
710 const char *attribute);
711 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
712 const char *attribute);
713 GObject * g_file_info_get_attribute_object (GFileInfo *info,
714 const char *attribute);
716 void g_file_info_set_attribute (GFileInfo *info,
717 const char *attribute,
718 GFileAttributeType type,
720 void g_file_info_set_attribute_string (GFileInfo *info,
721 const char *attribute,
722 const char *attr_value);
723 void g_file_info_set_attribute_byte_string (GFileInfo *info,
724 const char *attribute,
725 const char *attr_value);
726 void g_file_info_set_attribute_boolean (GFileInfo *info,
727 const char *attribute,
728 gboolean attr_value);
729 void g_file_info_set_attribute_uint32 (GFileInfo *info,
730 const char *attribute,
732 void g_file_info_set_attribute_int32 (GFileInfo *info,
733 const char *attribute,
735 void g_file_info_set_attribute_uint64 (GFileInfo *info,
736 const char *attribute,
738 void g_file_info_set_attribute_int64 (GFileInfo *info,
739 const char *attribute,
741 void g_file_info_set_attribute_object (GFileInfo *info,
742 const char *attribute,
743 GObject *attr_value);
745 void g_file_info_clear_status (GFileInfo *info);
747 /* Helper getters: */
748 GFileType g_file_info_get_file_type (GFileInfo *info);
749 gboolean g_file_info_get_is_hidden (GFileInfo *info);
750 gboolean g_file_info_get_is_backup (GFileInfo *info);
751 gboolean g_file_info_get_is_symlink (GFileInfo *info);
752 const char * g_file_info_get_name (GFileInfo *info);
753 const char * g_file_info_get_display_name (GFileInfo *info);
754 const char * g_file_info_get_edit_name (GFileInfo *info);
755 GIcon * g_file_info_get_icon (GFileInfo *info);
756 const char * g_file_info_get_content_type (GFileInfo *info);
757 goffset g_file_info_get_size (GFileInfo *info);
758 void g_file_info_get_modification_time (GFileInfo *info,
760 const char * g_file_info_get_symlink_target (GFileInfo *info);
761 const char * g_file_info_get_etag (GFileInfo *info);
762 gint32 g_file_info_get_sort_order (GFileInfo *info);
764 void g_file_info_set_attribute_mask (GFileInfo *info,
765 GFileAttributeMatcher *mask);
766 void g_file_info_unset_attribute_mask (GFileInfo *info);
768 /* Helper setters: */
769 void g_file_info_set_file_type (GFileInfo *info,
771 void g_file_info_set_is_hidden (GFileInfo *info,
773 void g_file_info_set_is_symlink (GFileInfo *info,
774 gboolean is_symlink);
775 void g_file_info_set_name (GFileInfo *info,
777 void g_file_info_set_display_name (GFileInfo *info,
778 const char *display_name);
779 void g_file_info_set_edit_name (GFileInfo *info,
780 const char *edit_name);
781 void g_file_info_set_icon (GFileInfo *info,
783 void g_file_info_set_content_type (GFileInfo *info,
784 const char *content_type);
785 void g_file_info_set_size (GFileInfo *info,
787 void g_file_info_set_modification_time (GFileInfo *info,
789 void g_file_info_set_symlink_target (GFileInfo *info,
790 const char *symlink_target);
791 void g_file_info_set_sort_order (GFileInfo *info,
794 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
795 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
796 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
797 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
798 const char *attribute);
799 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
800 const char *attribute);
801 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
803 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
808 #endif /* __G_FILE_INFO_H__ */