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 <gio/giotypes.h>
34 #define G_TYPE_FILE_INFO (g_file_info_get_type ())
35 #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
36 #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
37 #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
38 #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
39 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
44 * Stores information about a file system object referenced by a #GFile.
46 typedef struct _GFileInfoClass GFileInfoClass;
49 /* Common Attributes: */
51 * G_FILE_ATTRIBUTE_STANDARD_TYPE:
53 * A key in the "standard" namespace for storing file types.
54 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
55 * The value for this key should contain a #GFileType.
57 #define G_FILE_ATTRIBUTE_STANDARD_TYPE "standard::type" /* uint32 (GFileType) */
60 * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
62 * A key in the "standard" namespace for checking if a file is hidden.
63 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
65 #define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden" /* boolean */
68 * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
70 * A key in the "standard" namespace for checking if a file is a backup file.
71 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
73 #define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup" /* boolean */
76 * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
78 * A key in the "standard" namespace for checking if the file is a symlink.
79 * Typically the actual type is something else, if we followed the symlink
81 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
83 #define G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK "standard::is-symlink" /* boolean */
86 * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
88 * A key in the "standard" namespace for checking if a file is virtual.
89 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
91 #define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
94 * G_FILE_ATTRIBUTE_STANDARD_NAME:
96 * A key in the "standard" namespace for getting the name of the file.
97 * The name is the on-disk filename which may not be in any known encoding,
98 * and can thus not be generally displayed as is.
99 * Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
100 * name in a user interface.
101 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
103 #define G_FILE_ATTRIBUTE_STANDARD_NAME "standard::name" /* byte string */
106 * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
108 * A key in the "standard" namespace for getting the display name of the file.
109 * A display name is guaranteed to be in UTF8 and can thus be displayed in
111 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
113 #define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name" /* string */
116 * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
118 * A key in the "standard" namespace for edit name of the file.
119 * An edit name is similar to the display name, but it is meant to be
120 * used when you want to rename the file in the UI. The display name
121 * might contain information you don't want in the new filename (such as
122 * "(invalid unicode)" if the filename was in an invalid encoding).
124 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
126 #define G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME "standard::edit-name" /* string */
129 * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
131 * A key in the "standard" namespace for getting the copy name of the file.
132 * The copy name is an optional version of the name. If available it's always
133 * in UTF8, and corresponds directly to the original filename (only transcoded to
134 * UTF8). This is useful if you want to copy the file to another filesystem that
135 * might have a different encoding. If the filename is not a valid string in the
136 * encoding selected for the filesystem it is in then the copy name will not be set.
138 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
140 #define G_FILE_ATTRIBUTE_STANDARD_COPY_NAME "standard::copy-name" /* string */
143 * G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION:
145 * A key in the "standard" namespace for getting the description of the file.
146 * The description is a utf8 string that describes the file, generally containing
147 * the filename, but can also contain furter information. Example descriptions
148 * could be "filename (on hostname)" for a remote file or "filename (in trash)"
149 * for a file in the trash. This is useful for instance as the window title
150 * when displaying a directory or for a bookmarks menu.
152 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
154 #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description" /* string */
157 * G_FILE_ATTRIBUTE_STANDARD_ICON:
159 * A key in the "standard" namespace for getting the icon for the file.
160 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
161 * The value for this key should contain a #GIcon.
163 #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon" /* object (GIcon) */
166 * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
168 * A key in the "standard" namespace for getting the content type of the file.
169 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
170 * The value for this key should contain a valid content type.
172 #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
175 * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
177 * A key in the "standard" namespace for getting the fast content type.
178 * The fast content type isn't as reliable as the regular one, as it
179 * only uses the filename to guess it, but it is faster to calculate than the
180 * regular content type.
181 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
184 #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
187 * G_FILE_ATTRIBUTE_STANDARD_SIZE:
189 * A key in the "standard" namespace for getting the file's size (in bytes).
190 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
192 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
195 * G_FILE_ATTRIBUTE_ALLOCATED_SIZE:
197 * A key in the "standard" namespace for getting the amount of disk space
198 * that is consumed by the file (in bytes). This will generally be larger
199 * than the file size (due to block size overhead) but can occasionally be
200 * smaller (for example, for sparse files).
202 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
204 #define G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE "standard::allocated-size" /* uint64 */
207 * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
209 * A key in the "standard" namespace for getting the symlink target, if the file
210 * is a symlink. Corresponding #GFileAttributeType is
211 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
213 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
216 * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
218 * A key in the "standard" namespace for getting the target URI for the file, in
219 * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
220 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
222 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri" /* string */
225 * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
227 * A key in the "standard" namespace for setting the sort order of a file.
228 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
229 * An example use would be in file managers, which would use this key
230 * to set the order files are displayed. Files with smaller sort order
231 * should be sorted first, and files without sort order as if sort order
234 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order" /* int32 */
236 /* Entity tags, used to avoid missing updates on save */
239 * G_FILE_ATTRIBUTE_ETAG_VALUE:
241 * A key in the "etag" namespace for getting the value of the file's
242 * entity tag. Corresponding #GFileAttributeType is
243 * %G_FILE_ATTRIBUTE_TYPE_STRING.
245 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
247 /* File identifier, for e.g. avoiding loops when doing recursive
252 * G_FILE_ATTRIBUTE_ID_FILE:
254 * A key in the "id" namespace for getting a file identifier.
255 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
256 * An example use would be during listing files, to avoid recursive
257 * directory scanning.
259 #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
262 * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
264 * A key in the "id" namespace for getting the file system identifier.
265 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
266 * An example use would be during drag and drop to see if the source
267 * and target are on the same filesystem (default to move) or not (default
270 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
272 /* Calculated Access Rights for current user */
275 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
277 * A key in the "access" namespace for getting read privileges.
278 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
279 * This attribute will be %TRUE if the user is able to read the file.
281 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
284 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
286 * A key in the "access" namespace for getting write privileges.
287 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
288 * This attribute will be %TRUE if the user is able to write to the file.
290 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
293 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
295 * A key in the "access" namespace for getting execution privileges.
296 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
297 * This attribute will be %TRUE if the user is able to execute the file.
299 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
302 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
304 * A key in the "access" namespace for checking deletion privileges.
305 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
306 * This attribute will be %TRUE if the user is able to delete the file.
308 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
311 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
313 * A key in the "access" namespace for checking trashing privileges.
314 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
315 * This attribute will be %TRUE if the user is able to move the file to
318 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
321 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
323 * A key in the "access" namespace for checking renaming privileges.
324 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
325 * This attribute will be %TRUE if the user is able to rename the file.
327 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
329 /* TODO: Should we have special version for directories? can_enumerate, etc */
331 /* Mountable attributes */
334 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
336 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
337 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
339 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
342 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
344 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
345 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
347 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
350 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
352 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
353 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
355 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
358 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
360 * A key in the "mountable" namespace for getting the unix device.
361 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
363 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
366 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE:
368 * A key in the "mountable" namespace for getting the unix device file.
369 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
373 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE "mountable::unix-device-file" /* string */
376 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
378 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
379 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
381 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
384 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START:
386 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started.
387 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
391 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START "mountable::can-start" /* boolean */
394 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED:
396 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started
398 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
402 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED "mountable::can-start-degraded" /* boolean */
405 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP:
407 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be stopped.
408 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
412 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP "mountable::can-stop" /* boolean */
415 * G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE:
417 * A key in the "mountable" namespace for getting the #GDriveStartStopType.
418 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
422 #define G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE "mountable::start-stop-type" /* uint32 (GDriveStartStopType) */
425 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL:
427 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be polled.
428 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
432 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL "mountable::can-poll" /* boolean */
435 * G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC:
437 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)
438 * is automatically polled for media.
439 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
443 #define G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC "mountable::is-media-check-automatic" /* boolean */
445 /* Time attributes */
448 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
450 * A key in the "time" namespace for getting the time the file was last
451 * modified. Corresponding #GFileAttributeType is
452 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
455 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
458 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
460 * A key in the "time" namespace for getting the miliseconds of the time
461 * the file was last modified. This should be used in conjunction with
462 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
463 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
465 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
468 * G_FILE_ATTRIBUTE_TIME_ACCESS:
470 * A key in the "time" namespace for getting the time the file was last
471 * accessed. Corresponding #GFileAttributeType is
472 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
473 * file was last accessed.
475 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
478 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
480 * A key in the "time" namespace for getting the microseconds of the time
481 * the file was last accessed. This should be used in conjunction with
482 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
483 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
485 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
488 * G_FILE_ATTRIBUTE_TIME_CHANGED:
490 * A key in the "time" namespace for getting the time the file was last
491 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
492 * and contains the UNIX time since the file was last changed.
494 * This corresponds to the traditional UNIX ctime.
496 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
499 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
501 * A key in the "time" namespace for getting the microseconds of the time
502 * the file was last changed. This should be used in conjunction with
503 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
504 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
506 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
509 * G_FILE_ATTRIBUTE_TIME_CREATED:
511 * A key in the "time" namespace for getting the time the file was created.
512 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
513 * and contains the UNIX time since the file was created.
515 * This corresponds to the NTFS ctime.
517 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
520 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
522 * A key in the "time" namespace for getting the microseconds of the time
523 * the file was created. This should be used in conjunction with
524 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
525 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
527 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
529 /* Unix specific attributes */
532 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
534 * A key in the "unix" namespace for getting the device id of the device the
535 * file is located on (see stat() documentation). This attribute is only
536 * available for UNIX file systems. Corresponding #GFileAttributeType is
537 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
539 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
542 * G_FILE_ATTRIBUTE_UNIX_INODE:
544 * A key in the "unix" namespace for getting the inode of the file.
545 * This attribute is only available for UNIX file systems. Corresponding
546 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
548 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
551 * G_FILE_ATTRIBUTE_UNIX_MODE:
553 * A key in the "unix" namespace for getting the mode of the file
554 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
555 * documentation. This attribute is only available for UNIX file systems.
556 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
558 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
561 * G_FILE_ATTRIBUTE_UNIX_NLINK:
563 * A key in the "unix" namespace for getting the number of hard links
564 * for a file. See lstat() documentation. This attribute is only available
565 * for UNIX file systems. Corresponding #GFileAttributeType is
566 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
568 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
571 * G_FILE_ATTRIBUTE_UNIX_UID:
573 * A key in the "unix" namespace for getting the user ID for the file.
574 * This attribute is only available for UNIX file systems.
575 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
577 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
580 * G_FILE_ATTRIBUTE_UNIX_GID:
582 * A key in the "unix" namespace for getting the group ID for the file.
583 * This attribute is only available for UNIX file systems.
584 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
586 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
589 * G_FILE_ATTRIBUTE_UNIX_RDEV:
591 * A key in the "unix" namespace for getting the device ID for the file
592 * (if it is a special file). See lstat() documentation. This attribute
593 * is only available for UNIX file systems. Corresponding #GFileAttributeType
594 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
596 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
599 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
601 * A key in the "unix" namespace for getting the block size for the file
602 * system. This attribute is only available for UNIX file systems.
603 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
605 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
608 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
610 * A key in the "unix" namespace for getting the number of blocks allocated
611 * for the file. This attribute is only available for UNIX file systems.
612 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
614 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
617 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
619 * A key in the "unix" namespace for checking if the file represents a
620 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
621 * point. This attribute is only available for UNIX file systems.
622 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
624 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
626 /* DOS specific attributes */
629 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
631 * A key in the "dos" namespace for checking if the file's archive flag
632 * is set. This attribute is %TRUE if the archive flag is set. This attribute
633 * is only available for DOS file systems. Corresponding #GFileAttributeType
634 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
636 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
639 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
641 * A key in the "dos" namespace for checking if the file's backup flag
642 * is set. This attribute is %TRUE if the backup flag is set. This attribute
643 * is only available for DOS file systems. Corresponding #GFileAttributeType
644 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
646 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
648 /* Owner attributes */
651 * G_FILE_ATTRIBUTE_OWNER_USER:
653 * A key in the "owner" namespace for getting the user name of the
654 * file's owner. Corresponding #GFileAttributeType is
655 * %G_FILE_ATTRIBUTE_TYPE_STRING.
657 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
660 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
662 * A key in the "owner" namespace for getting the real name of the
663 * user that owns the file. Corresponding #GFileAttributeType is
664 * %G_FILE_ATTRIBUTE_TYPE_STRING.
666 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
669 * G_FILE_ATTRIBUTE_OWNER_GROUP:
671 * A key in the "owner" namespace for getting the file owner's group.
672 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
674 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
679 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
681 * A key in the "thumbnail" namespace for getting the path to the thumbnail
682 * image. Corresponding #GFileAttributeType is
683 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
685 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
687 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
689 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
690 * This attribute is %TRUE if thumbnailing failed. Corresponding
691 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
693 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
698 * G_FILE_ATTRIBUTE_PREVIEW_ICON:
700 * A key in the "preview" namespace for getting a #GIcon that can be
701 * used to get preview of the file. For example, it may be a low
702 * resolution thumbnail without metadata. Corresponding
703 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT. The value
704 * for this key should contain a #GIcon.
708 #define G_FILE_ATTRIBUTE_PREVIEW_ICON "preview::icon" /* object (GIcon) */
710 /* File system info (for g_file_get_filesystem_info) */
713 * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
715 * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
716 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
717 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
719 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
722 * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
724 * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
725 * file system. Corresponding #GFileAttributeType is
726 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
728 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
731 * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
733 * A key in the "filesystem" namespace for getting the file system's type.
734 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
736 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
739 * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
741 * A key in the "filesystem" namespace for checking if the file system
742 * is read only. Is set to %TRUE if the file system is read only.
743 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
745 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
748 * G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW:
750 * A key in the "filesystem" namespace for hinting a file manager
751 * application whether it should preview (e.g. thumbnail) files on the
752 * file system. The value for this key contain a
753 * #GFilesystemPreviewType.
755 #define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview" /* uint32 (GFilesystemPreviewType) */
758 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
760 * A key in the "gvfs" namespace that gets the name of the current
761 * GVFS backend in use. Corresponding #GFileAttributeType is
762 * %G_FILE_ATTRIBUTE_TYPE_STRING.
764 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
767 * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
769 * A key in the "selinux" namespace for getting the file's SELinux
770 * context. Corresponding #GFileAttributeType is
771 * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
772 * available if GLib has been built with SELinux support.
774 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
777 * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
779 * A key in the "trash" namespace. When requested against
780 * "trash:///" returns the number of (toplevel) items in the trash folder.
781 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
783 #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count" /* uint32 */
785 GType g_file_info_get_type (void) G_GNUC_CONST;
787 GFileInfo * g_file_info_new (void);
788 GFileInfo * g_file_info_dup (GFileInfo *other);
789 void g_file_info_copy_into (GFileInfo *src_info,
790 GFileInfo *dest_info);
791 gboolean g_file_info_has_attribute (GFileInfo *info,
792 const char *attribute);
793 gboolean g_file_info_has_namespace (GFileInfo *info,
794 const char *name_space);
795 char ** g_file_info_list_attributes (GFileInfo *info,
796 const char *name_space);
797 gboolean g_file_info_get_attribute_data (GFileInfo *info,
798 const char *attribute,
799 GFileAttributeType *type,
801 GFileAttributeStatus *status);
802 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
803 const char *attribute);
804 void g_file_info_remove_attribute (GFileInfo *info,
805 const char *attribute);
806 GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
807 const char *attribute);
808 gboolean g_file_info_set_attribute_status (GFileInfo *info,
809 const char *attribute,
810 GFileAttributeStatus status);
811 char * g_file_info_get_attribute_as_string (GFileInfo *info,
812 const char *attribute);
813 const char * g_file_info_get_attribute_string (GFileInfo *info,
814 const char *attribute);
815 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
816 const char *attribute);
817 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
818 const char *attribute);
819 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
820 const char *attribute);
821 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
822 const char *attribute);
823 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
824 const char *attribute);
825 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
826 const char *attribute);
827 GObject * g_file_info_get_attribute_object (GFileInfo *info,
828 const char *attribute);
829 char ** g_file_info_get_attribute_stringv (GFileInfo *info,
830 const char *attribute);
832 void g_file_info_set_attribute (GFileInfo *info,
833 const char *attribute,
834 GFileAttributeType type,
836 void g_file_info_set_attribute_string (GFileInfo *info,
837 const char *attribute,
838 const char *attr_value);
839 void g_file_info_set_attribute_byte_string (GFileInfo *info,
840 const char *attribute,
841 const char *attr_value);
842 void g_file_info_set_attribute_boolean (GFileInfo *info,
843 const char *attribute,
844 gboolean attr_value);
845 void g_file_info_set_attribute_uint32 (GFileInfo *info,
846 const char *attribute,
848 void g_file_info_set_attribute_int32 (GFileInfo *info,
849 const char *attribute,
851 void g_file_info_set_attribute_uint64 (GFileInfo *info,
852 const char *attribute,
854 void g_file_info_set_attribute_int64 (GFileInfo *info,
855 const char *attribute,
857 void g_file_info_set_attribute_object (GFileInfo *info,
858 const char *attribute,
859 GObject *attr_value);
860 void g_file_info_set_attribute_stringv (GFileInfo *info,
861 const char *attribute,
864 void g_file_info_clear_status (GFileInfo *info);
866 /* Helper getters: */
867 GFileType g_file_info_get_file_type (GFileInfo *info);
868 gboolean g_file_info_get_is_hidden (GFileInfo *info);
869 gboolean g_file_info_get_is_backup (GFileInfo *info);
870 gboolean g_file_info_get_is_symlink (GFileInfo *info);
871 const char * g_file_info_get_name (GFileInfo *info);
872 const char * g_file_info_get_display_name (GFileInfo *info);
873 const char * g_file_info_get_edit_name (GFileInfo *info);
874 GIcon * g_file_info_get_icon (GFileInfo *info);
875 const char * g_file_info_get_content_type (GFileInfo *info);
876 goffset g_file_info_get_size (GFileInfo *info);
877 void g_file_info_get_modification_time (GFileInfo *info,
879 const char * g_file_info_get_symlink_target (GFileInfo *info);
880 const char * g_file_info_get_etag (GFileInfo *info);
881 gint32 g_file_info_get_sort_order (GFileInfo *info);
883 void g_file_info_set_attribute_mask (GFileInfo *info,
884 GFileAttributeMatcher *mask);
885 void g_file_info_unset_attribute_mask (GFileInfo *info);
887 /* Helper setters: */
888 void g_file_info_set_file_type (GFileInfo *info,
890 void g_file_info_set_is_hidden (GFileInfo *info,
892 void g_file_info_set_is_symlink (GFileInfo *info,
893 gboolean is_symlink);
894 void g_file_info_set_name (GFileInfo *info,
896 void g_file_info_set_display_name (GFileInfo *info,
897 const char *display_name);
898 void g_file_info_set_edit_name (GFileInfo *info,
899 const char *edit_name);
900 void g_file_info_set_icon (GFileInfo *info,
902 void g_file_info_set_content_type (GFileInfo *info,
903 const char *content_type);
904 void g_file_info_set_size (GFileInfo *info,
906 void g_file_info_set_modification_time (GFileInfo *info,
908 void g_file_info_set_symlink_target (GFileInfo *info,
909 const char *symlink_target);
910 void g_file_info_set_sort_order (GFileInfo *info,
913 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
914 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
915 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
916 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
917 const char *attribute);
918 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
919 const char *attribute);
920 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
922 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
926 #endif /* __G_FILE_INFO_H__ */