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_STANDARD_TYPE:
87 * A key in the "standard" 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_STANDARD_TYPE "standard::type" /* uint32 (GFileType) */
94 * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
96 * A key in the "standard" namespace for checking if a file is hidden.
97 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
99 #define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden" /* boolean */
102 * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
104 * A key in the "standard" namespace for checking if a file is a backup file.
105 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
107 #define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup" /* boolean */
110 * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
112 * A key in the "standard" 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_STANDARD_IS_SYMLINK "standard::is-symlink" /* boolean */
120 * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
122 * A key in the "standard" namespace for checking if a file is virtual.
123 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
125 #define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
128 * G_FILE_ATTRIBUTE_STANDARD_NAME:
130 * A key in the "standard" 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_STANDARD_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_STANDARD_NAME "standard::name" /* byte string */
140 * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
142 * A key in the "standard" 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_STANDARD_DISPLAY_NAME "standard::display-name" /* string */
150 * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
152 * A key in the "standard" 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_STANDARD_EDIT_NAME "standard::edit-name" /* string */
163 * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
165 * A key in the "standard" 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_STANDARD_COPY_NAME "standard::copy-name" /* string */
177 * G_FILE_ATTRIBUTE_STANDARD_ICON:
179 * A key in the "standard" 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_STANDARD_ICON "standard::icon" /* object (GIcon) */
186 * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
188 * A key in the "standard" 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_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
195 * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
197 * A key in the "standard" 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_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
207 * G_FILE_ATTRIBUTE_STANDARD_SIZE:
209 * A key in the "standard" namespace for getting the file's size (in bytes).
210 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
212 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
215 * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
217 * A key in the "standard" 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_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
224 * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
226 * A key in the "standard" 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_STANDARD_TARGET_URI "standard::target-uri" /* string */
233 * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
235 * A key in the "standard" 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_STANDARD_SORT_ORDER "standard::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_FILESYSTEM:
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 drag and drop to see if the source
275 * and target are on the same filesystem (default to move) or not (default
278 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
280 /* Calculated Access Rights for current user */
283 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
285 * A key in the "access" namespace for getting read privileges.
286 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
287 * This attribute will be %TRUE if the user is able to read the file.
289 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
292 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
294 * A key in the "access" namespace for getting write privileges.
295 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
296 * This attribute will be %TRUE if the user is able to write to the file.
298 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
301 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
303 * A key in the "access" namespace for getting execution privileges.
304 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
305 * This attribute will be %TRUE if the user is able to execute the file.
307 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
310 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
312 * A key in the "access" namespace for checking deletion privileges.
313 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
314 * This attribute will be %TRUE if the user is able to delete the file.
316 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
319 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
321 * A key in the "access" namespace for checking trashing privileges.
322 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
323 * This attribute will be %TRUE if the user is able to move the file to
326 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
329 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
331 * A key in the "access" namespace for checking renaming privileges.
332 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
333 * This attribute will be %TRUE if the user is able to rename the file.
335 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
337 /* TODO: Should we have special version for directories? can_enumerate, etc */
339 /* Mountable attributes */
342 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
344 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
345 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
347 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
350 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
352 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
353 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
355 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
358 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
360 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
361 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
363 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
366 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
368 * A key in the "mountable" namespace for getting the unix device.
369 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
371 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
374 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
376 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
377 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
379 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
381 /* Time attributes */
384 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
386 * A key in the "time" namespace for getting the time the file was last
387 * modified. Corresponding #GFileAttributeType is
388 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
391 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
394 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
396 * A key in the "time" namespace for getting the milliseconds of the time
397 * the file was last modified. This should be used in conjunction with
398 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
399 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
401 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
404 * G_FILE_ATTRIBUTE_TIME_ACCESS:
406 * A key in the "time" namespace for getting the time the file was last
407 * accessed. Corresponding #GFileAttributeType is
408 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
409 * file was last accessed.
411 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
414 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
416 * A key in the "time" namespace for getting the milliseconds of the time
417 * the file was last accessed. This should be used in conjunction with
418 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
419 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
421 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
424 * G_FILE_ATTRIBUTE_TIME_CHANGED:
426 * A key in the "time" namespace for getting the time the file was last
427 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
428 * and contains the UNIX time since the file was last changed.
430 * This corresponds to the traditional UNIX ctime.
432 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
435 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
437 * A key in the "time" namespace for getting the milliseconds of the time
438 * the file was last changed. This should be used in conjunction with
439 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
440 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
442 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
445 * G_FILE_ATTRIBUTE_TIME_CREATED:
447 * A key in the "time" namespace for getting the time the file was created.
448 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
449 * and contains the UNIX time since the file was created.
451 * This corresponds to the NTFS ctime.
453 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
456 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
458 * A key in the "time" namespace for getting the milliseconds of the time
459 * the file was created. This should be used in conjunction with
460 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
461 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
463 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
465 /* Unix specific attributes */
468 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
470 * A key in the "unix" namespace for getting the device id of the device the
471 * file is located on (see stat() documentation). This attribute is only
472 * available for UNIX file systems. Corresponding #GFileAttributeType is
473 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
475 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
478 * G_FILE_ATTRIBUTE_UNIX_INODE:
480 * A key in the "unix" namespace for getting the inode of the file.
481 * This attribute is only available for UNIX file systems. Corresponding
482 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
484 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
487 * G_FILE_ATTRIBUTE_UNIX_MODE:
489 * A key in the "unix" namespace for getting the mode of the file
490 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
491 * documentation. This attribute is only available for UNIX file systems.
492 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
494 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
497 * G_FILE_ATTRIBUTE_UNIX_NLINK:
499 * A key in the "unix" namespace for getting the number of hard links
500 * for a file. See lstat() documentation. This attribute is only available
501 * for UNIX file systems. Corresponding #GFileAttributeType is
502 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
504 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
507 * G_FILE_ATTRIBUTE_UNIX_UID:
509 * A key in the "unix" namespace for getting the user ID for the file.
510 * This attribute is only available for UNIX file systems.
511 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
513 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
516 * G_FILE_ATTRIBUTE_UNIX_GID:
518 * A key in the "unix" namespace for getting the group ID for the file.
519 * This attribute is only available for UNIX file systems.
520 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
522 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
525 * G_FILE_ATTRIBUTE_UNIX_RDEV:
527 * A key in the "unix" namespace for getting the device ID for the file
528 * (if it is a special file). See lstat() documentation. This attribute
529 * is only available for UNIX file systems. Corresponding #GFileAttributeType
530 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
532 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
535 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
537 * A key in the "unix" namespace for getting the block size for the file
538 * system. This attribute is only available for UNIX file systems.
539 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
541 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
544 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
546 * A key in the "unix" namespace for getting the number of blocks allocated
547 * for the file. This attribute is only available for UNIX file systems.
548 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
550 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
553 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
555 * A key in the "unix" namespace for checking if the file represents a
556 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
557 * point. This attribute is only available for UNIX file systems.
558 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
560 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
562 /* DOS specific attributes */
565 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
567 * A key in the "dos" namespace for checking if the file's archive flag
568 * is set. This attribute is %TRUE if the archive flag is set. This attribute
569 * is only available for DOS file systems. Corresponding #GFileAttributeType
570 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
572 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
575 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
577 * A key in the "dos" namespace for checking if the file's backup flag
578 * is set. This attribute is %TRUE if the backup flag is set. This attribute
579 * is only available for DOS file systems. Corresponding #GFileAttributeType
580 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
582 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
584 /* Owner attributes */
587 * G_FILE_ATTRIBUTE_OWNER_USER:
589 * A key in the "owner" namespace for getting the user name of the
590 * file's owner. Corresponding #GFileAttributeType is
591 * %G_FILE_ATTRIBUTE_TYPE_STRING.
593 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
596 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
598 * A key in the "owner" namespace for getting the real name of the
599 * user that owns the file. Corresponding #GFileAttributeType is
600 * %G_FILE_ATTRIBUTE_TYPE_STRING.
602 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
605 * G_FILE_ATTRIBUTE_OWNER_GROUP:
607 * A key in the "owner" namespace for getting the file owner's group.
608 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
610 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
615 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
617 * A key in the "thumbnail" namespace for getting the path to the thumbnail
618 * image. Corresponding #GFileAttributeType is
619 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
621 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
623 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
625 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
626 * This attribute is %TRUE if thumbnailing failed. Corresponding
627 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
629 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
631 /* File system info (for g_file_get_filesystem_info) */
634 * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
636 * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
637 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
638 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
640 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
643 * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
645 * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
646 * file system. Corresponding #GFileAttributeType is
647 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
649 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
652 * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
654 * A key in the "filesystem" namespace for getting the file system's type.
655 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
657 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
660 * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
662 * A key in the "filesystem" namespace for checking if the file system is read only.
663 * Is set to %TRUE if the file system is read only. Corresponding
664 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
666 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
669 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
671 * A key in the "gvfs" namespace that gets the name of the current
672 * GVFS backend in use. Corresponding #GFileAttributeType is
673 * %G_FILE_ATTRIBUTE_TYPE_STRING.
675 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
677 GType g_file_info_get_type (void) G_GNUC_CONST;
679 GFileInfo * g_file_info_new (void);
680 GFileInfo * g_file_info_dup (GFileInfo *other);
681 void g_file_info_copy_into (GFileInfo *src_info,
682 GFileInfo *dest_info);
683 gboolean g_file_info_has_attribute (GFileInfo *info,
684 const char *attribute);
685 char ** g_file_info_list_attributes (GFileInfo *info,
686 const char *name_space);
687 gboolean g_file_info_get_attribute_data (GFileInfo *info,
688 const char *attribute,
689 GFileAttributeType *type,
691 GFileAttributeStatus *status);
692 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
693 const char *attribute);
694 void g_file_info_remove_attribute (GFileInfo *info,
695 const char *attribute);
696 GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
697 const char *attribute);
698 char * g_file_info_get_attribute_as_string (GFileInfo *info,
699 const char *attribute);
700 const char * g_file_info_get_attribute_string (GFileInfo *info,
701 const char *attribute);
702 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
703 const char *attribute);
704 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
705 const char *attribute);
706 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
707 const char *attribute);
708 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
709 const char *attribute);
710 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
711 const char *attribute);
712 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
713 const char *attribute);
714 GObject * g_file_info_get_attribute_object (GFileInfo *info,
715 const char *attribute);
717 void g_file_info_set_attribute (GFileInfo *info,
718 const char *attribute,
719 GFileAttributeType type,
721 void g_file_info_set_attribute_string (GFileInfo *info,
722 const char *attribute,
723 const char *attr_value);
724 void g_file_info_set_attribute_byte_string (GFileInfo *info,
725 const char *attribute,
726 const char *attr_value);
727 void g_file_info_set_attribute_boolean (GFileInfo *info,
728 const char *attribute,
729 gboolean attr_value);
730 void g_file_info_set_attribute_uint32 (GFileInfo *info,
731 const char *attribute,
733 void g_file_info_set_attribute_int32 (GFileInfo *info,
734 const char *attribute,
736 void g_file_info_set_attribute_uint64 (GFileInfo *info,
737 const char *attribute,
739 void g_file_info_set_attribute_int64 (GFileInfo *info,
740 const char *attribute,
742 void g_file_info_set_attribute_object (GFileInfo *info,
743 const char *attribute,
744 GObject *attr_value);
746 void g_file_info_clear_status (GFileInfo *info);
748 /* Helper getters: */
749 GFileType g_file_info_get_file_type (GFileInfo *info);
750 gboolean g_file_info_get_is_hidden (GFileInfo *info);
751 gboolean g_file_info_get_is_backup (GFileInfo *info);
752 gboolean g_file_info_get_is_symlink (GFileInfo *info);
753 const char * g_file_info_get_name (GFileInfo *info);
754 const char * g_file_info_get_display_name (GFileInfo *info);
755 const char * g_file_info_get_edit_name (GFileInfo *info);
756 GIcon * g_file_info_get_icon (GFileInfo *info);
757 const char * g_file_info_get_content_type (GFileInfo *info);
758 goffset g_file_info_get_size (GFileInfo *info);
759 void g_file_info_get_modification_time (GFileInfo *info,
761 const char * g_file_info_get_symlink_target (GFileInfo *info);
762 const char * g_file_info_get_etag (GFileInfo *info);
763 gint32 g_file_info_get_sort_order (GFileInfo *info);
765 void g_file_info_set_attribute_mask (GFileInfo *info,
766 GFileAttributeMatcher *mask);
767 void g_file_info_unset_attribute_mask (GFileInfo *info);
769 /* Helper setters: */
770 void g_file_info_set_file_type (GFileInfo *info,
772 void g_file_info_set_is_hidden (GFileInfo *info,
774 void g_file_info_set_is_symlink (GFileInfo *info,
775 gboolean is_symlink);
776 void g_file_info_set_name (GFileInfo *info,
778 void g_file_info_set_display_name (GFileInfo *info,
779 const char *display_name);
780 void g_file_info_set_edit_name (GFileInfo *info,
781 const char *edit_name);
782 void g_file_info_set_icon (GFileInfo *info,
784 void g_file_info_set_content_type (GFileInfo *info,
785 const char *content_type);
786 void g_file_info_set_size (GFileInfo *info,
788 void g_file_info_set_modification_time (GFileInfo *info,
790 void g_file_info_set_symlink_target (GFileInfo *info,
791 const char *symlink_target);
792 void g_file_info_set_sort_order (GFileInfo *info,
795 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
796 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
797 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
798 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
799 const char *attribute);
800 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
801 const char *attribute);
802 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
804 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
809 #endif /* __G_FILE_INFO_H__ */