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, see <http://www.gnu.org/licenses/>.
18 * Author: Alexander Larsson <alexl@redhat.com>
21 #ifndef __G_FILE_INFO_H__
22 #define __G_FILE_INFO_H__
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
28 #include <gio/giotypes.h>
32 #define G_TYPE_FILE_INFO (g_file_info_get_type ())
33 #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
34 #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
35 #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
36 #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
37 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
42 * Stores information about a file system object referenced by a #GFile.
44 typedef struct _GFileInfoClass GFileInfoClass;
47 /* Common Attributes: */
49 * G_FILE_ATTRIBUTE_STANDARD_TYPE:
51 * A key in the "standard" namespace for storing file types.
52 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
53 * The value for this key should contain a #GFileType.
55 #define G_FILE_ATTRIBUTE_STANDARD_TYPE "standard::type" /* uint32 (GFileType) */
58 * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
60 * A key in the "standard" namespace for checking if a file is hidden.
61 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
63 #define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden" /* boolean */
66 * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
68 * A key in the "standard" namespace for checking if a file is a backup file.
69 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
71 #define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup" /* boolean */
74 * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
76 * A key in the "standard" namespace for checking if the file is a symlink.
77 * Typically the actual type is something else, if we followed the symlink
79 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
81 #define G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK "standard::is-symlink" /* boolean */
84 * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
86 * A key in the "standard" namespace for checking if a file is virtual.
87 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
89 #define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
92 * G_FILE_ATTRIBUTE_STANDARD_NAME:
94 * A key in the "standard" namespace for getting the name of the file.
95 * The name is the on-disk filename which may not be in any known encoding,
96 * and can thus not be generally displayed as is.
97 * Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
98 * name in a user interface.
99 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
101 #define G_FILE_ATTRIBUTE_STANDARD_NAME "standard::name" /* byte string */
104 * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
106 * A key in the "standard" namespace for getting the display name of the file.
107 * A display name is guaranteed to be in UTF8 and can thus be displayed in
109 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
111 #define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name" /* string */
114 * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
116 * A key in the "standard" namespace for edit name of the file.
117 * An edit name is similar to the display name, but it is meant to be
118 * used when you want to rename the file in the UI. The display name
119 * might contain information you don't want in the new filename (such as
120 * "(invalid unicode)" if the filename was in an invalid encoding).
122 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
124 #define G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME "standard::edit-name" /* string */
127 * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
129 * A key in the "standard" namespace for getting the copy name of the file.
130 * The copy name is an optional version of the name. If available it's always
131 * in UTF8, and corresponds directly to the original filename (only transcoded to
132 * UTF8). This is useful if you want to copy the file to another filesystem that
133 * might have a different encoding. If the filename is not a valid string in the
134 * encoding selected for the filesystem it is in then the copy name will not be set.
136 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
138 #define G_FILE_ATTRIBUTE_STANDARD_COPY_NAME "standard::copy-name" /* string */
141 * G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION:
143 * A key in the "standard" namespace for getting the description of the file.
144 * The description is a utf8 string that describes the file, generally containing
145 * the filename, but can also contain furter information. Example descriptions
146 * could be "filename (on hostname)" for a remote file or "filename (in trash)"
147 * for a file in the trash. This is useful for instance as the window title
148 * when displaying a directory or for a bookmarks menu.
150 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
152 #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description" /* string */
155 * G_FILE_ATTRIBUTE_STANDARD_ICON:
157 * A key in the "standard" namespace for getting the icon for the file.
158 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
159 * The value for this key should contain a #GIcon.
161 #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon" /* object (GIcon) */
164 * G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON:
166 * A key in the "standard" namespace for getting the symbolic icon for the file.
167 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
168 * The value for this key should contain a #GIcon.
172 #define G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON "standard::symbolic-icon" /* object (GIcon) */
175 * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
177 * A key in the "standard" namespace for getting the content type of the file.
178 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
179 * The value for this key should contain a valid content type.
181 #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
184 * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
186 * A key in the "standard" namespace for getting the fast content type.
187 * The fast content type isn't as reliable as the regular one, as it
188 * only uses the filename to guess it, but it is faster to calculate than the
189 * regular content type.
190 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
193 #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
196 * G_FILE_ATTRIBUTE_STANDARD_SIZE:
198 * A key in the "standard" namespace for getting the file's size (in bytes).
199 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
201 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
204 * G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE:
206 * A key in the "standard" namespace for getting the amount of disk space
207 * that is consumed by the file (in bytes). This will generally be larger
208 * than the file size (due to block size overhead) but can occasionally be
209 * smaller (for example, for sparse files).
210 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
214 #define G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE "standard::allocated-size" /* uint64 */
217 * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
219 * A key in the "standard" namespace for getting the symlink target, if the file
220 * is a symlink. Corresponding #GFileAttributeType is
221 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
223 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
226 * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
228 * A key in the "standard" namespace for getting the target URI for the file, in
229 * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
230 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
232 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri" /* string */
235 * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
237 * A key in the "standard" namespace for setting the sort order of a file.
238 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
239 * An example use would be in file managers, which would use this key
240 * to set the order files are displayed. Files with smaller sort order
241 * should be sorted first, and files without sort order as if sort order
244 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order" /* int32 */
246 /* Entity tags, used to avoid missing updates on save */
249 * G_FILE_ATTRIBUTE_ETAG_VALUE:
251 * A key in the "etag" namespace for getting the value of the file's
252 * entity tag. Corresponding #GFileAttributeType is
253 * %G_FILE_ATTRIBUTE_TYPE_STRING.
255 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
257 /* File identifier, for e.g. avoiding loops when doing recursive
262 * G_FILE_ATTRIBUTE_ID_FILE:
264 * A key in the "id" namespace for getting a file identifier.
265 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
266 * An example use would be during listing files, to avoid recursive
267 * directory scanning.
269 #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
272 * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
274 * A key in the "id" namespace for getting the file system identifier.
275 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
276 * An example use would be during drag and drop to see if the source
277 * and target are on the same filesystem (default to move) or not (default
280 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
282 /* Calculated Access Rights for current user */
285 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
287 * A key in the "access" namespace for getting read privileges.
288 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
289 * This attribute will be %TRUE if the user is able to read the file.
291 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
294 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
296 * A key in the "access" namespace for getting write privileges.
297 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
298 * This attribute will be %TRUE if the user is able to write to the file.
300 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
303 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
305 * A key in the "access" namespace for getting execution privileges.
306 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
307 * This attribute will be %TRUE if the user is able to execute the file.
309 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
312 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
314 * A key in the "access" namespace for checking deletion privileges.
315 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
316 * This attribute will be %TRUE if the user is able to delete the file.
318 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
321 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
323 * A key in the "access" namespace for checking trashing privileges.
324 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
325 * This attribute will be %TRUE if the user is able to move the file to
328 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
331 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
333 * A key in the "access" namespace for checking renaming privileges.
334 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
335 * This attribute will be %TRUE if the user is able to rename the file.
337 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
339 /* TODO: Should we have special version for directories? can_enumerate, etc */
341 /* Mountable attributes */
344 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
346 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
347 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
349 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
352 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
354 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
355 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
357 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
360 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
362 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
363 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
365 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
368 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
370 * A key in the "mountable" namespace for getting the unix device.
371 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
373 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
376 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE:
378 * A key in the "mountable" namespace for getting the unix device file.
379 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
383 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE "mountable::unix-device-file" /* string */
386 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
388 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
389 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
391 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
394 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START:
396 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started.
397 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
401 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START "mountable::can-start" /* boolean */
404 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED:
406 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be started
408 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
412 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED "mountable::can-start-degraded" /* boolean */
415 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP:
417 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be stopped.
418 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
422 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP "mountable::can-stop" /* boolean */
425 * G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE:
427 * A key in the "mountable" namespace for getting the #GDriveStartStopType.
428 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
432 #define G_FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE "mountable::start-stop-type" /* uint32 (GDriveStartStopType) */
435 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL:
437 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be polled.
438 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
442 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL "mountable::can-poll" /* boolean */
445 * G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC:
447 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE)
448 * is automatically polled for media.
449 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
453 #define G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC "mountable::is-media-check-automatic" /* boolean */
455 /* Time attributes */
458 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
460 * A key in the "time" namespace for getting the time the file was last
461 * modified. Corresponding #GFileAttributeType is
462 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
465 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
468 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
470 * A key in the "time" namespace for getting the miliseconds of the time
471 * the file was last modified. This should be used in conjunction with
472 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
473 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
475 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
478 * G_FILE_ATTRIBUTE_TIME_ACCESS:
480 * A key in the "time" namespace for getting the time the file was last
481 * accessed. Corresponding #GFileAttributeType is
482 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
483 * file was last accessed.
485 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
488 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
490 * A key in the "time" namespace for getting the microseconds of the time
491 * the file was last accessed. This should be used in conjunction with
492 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
493 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
495 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
498 * G_FILE_ATTRIBUTE_TIME_CHANGED:
500 * A key in the "time" namespace for getting the time the file was last
501 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
502 * and contains the UNIX time since the file was last changed.
504 * This corresponds to the traditional UNIX ctime.
506 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
509 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
511 * A key in the "time" namespace for getting the microseconds of the time
512 * the file was last changed. This should be used in conjunction with
513 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
514 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
516 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
519 * G_FILE_ATTRIBUTE_TIME_CREATED:
521 * A key in the "time" namespace for getting the time the file was created.
522 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
523 * and contains the UNIX time since the file was created.
525 * This corresponds to the NTFS ctime.
527 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
530 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
532 * A key in the "time" namespace for getting the microseconds of the time
533 * the file was created. This should be used in conjunction with
534 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
535 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
537 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
539 /* Unix specific attributes */
542 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
544 * A key in the "unix" namespace for getting the device id of the device the
545 * file is located on (see stat() documentation). This attribute is only
546 * available for UNIX file systems. Corresponding #GFileAttributeType is
547 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
549 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
552 * G_FILE_ATTRIBUTE_UNIX_INODE:
554 * A key in the "unix" namespace for getting the inode of the file.
555 * This attribute is only available for UNIX file systems. Corresponding
556 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
558 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
561 * G_FILE_ATTRIBUTE_UNIX_MODE:
563 * A key in the "unix" namespace for getting the mode of the file
564 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
565 * documentation. This attribute is only available for UNIX file systems.
566 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
568 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
571 * G_FILE_ATTRIBUTE_UNIX_NLINK:
573 * A key in the "unix" namespace for getting the number of hard links
574 * for a file. See lstat() documentation. This attribute is only available
575 * for UNIX file systems. Corresponding #GFileAttributeType is
576 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
578 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
581 * G_FILE_ATTRIBUTE_UNIX_UID:
583 * A key in the "unix" namespace for getting the user ID for the file.
584 * This attribute is only available for UNIX file systems.
585 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
587 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
590 * G_FILE_ATTRIBUTE_UNIX_GID:
592 * A key in the "unix" namespace for getting the group ID for the file.
593 * This attribute is only available for UNIX file systems.
594 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
596 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
599 * G_FILE_ATTRIBUTE_UNIX_RDEV:
601 * A key in the "unix" namespace for getting the device ID for the file
602 * (if it is a special file). See lstat() documentation. This attribute
603 * is only available for UNIX file systems. Corresponding #GFileAttributeType
604 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
606 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
609 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
611 * A key in the "unix" namespace for getting the block size for the file
612 * system. This attribute is only available for UNIX file systems.
613 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
615 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
618 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
620 * A key in the "unix" namespace for getting the number of blocks allocated
621 * for the file. This attribute is only available for UNIX file systems.
622 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
624 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
627 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
629 * A key in the "unix" namespace for checking if the file represents a
630 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
631 * point. This attribute is only available for UNIX file systems.
632 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
634 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
636 /* DOS specific attributes */
639 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
641 * A key in the "dos" namespace for checking if the file's archive flag
642 * is set. This attribute is %TRUE if the archive 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_ARCHIVE "dos::is-archive" /* boolean */
649 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
651 * A key in the "dos" namespace for checking if the file's backup flag
652 * is set. This attribute is %TRUE if the backup flag is set. This attribute
653 * is only available for DOS file systems. Corresponding #GFileAttributeType
654 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
656 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
658 /* Owner attributes */
661 * G_FILE_ATTRIBUTE_OWNER_USER:
663 * A key in the "owner" namespace for getting the user name of the
664 * file's owner. Corresponding #GFileAttributeType is
665 * %G_FILE_ATTRIBUTE_TYPE_STRING.
667 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
670 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
672 * A key in the "owner" namespace for getting the real name of the
673 * user that owns the file. Corresponding #GFileAttributeType is
674 * %G_FILE_ATTRIBUTE_TYPE_STRING.
676 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
679 * G_FILE_ATTRIBUTE_OWNER_GROUP:
681 * A key in the "owner" namespace for getting the file owner's group.
682 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
684 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
689 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
691 * A key in the "thumbnail" namespace for getting the path to the thumbnail
692 * image. Corresponding #GFileAttributeType is
693 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
695 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
697 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
699 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
700 * This attribute is %TRUE if thumbnailing failed. Corresponding
701 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
703 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
705 * G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID:
707 * A key in the "thumbnail" namespace for checking whether the thumbnail is outdated.
708 * This attribute is %TRUE if the thumbnail is up-to-date with the file it represents,
709 * and %FALSE if the file has been modified since the thumbnail was generated.
711 * If %G_FILE_ATTRIBUTE_THUMBNAILING_FAILED is %TRUE and this attribute is %FALSE,
712 * it indicates that thumbnailing may be attempted again and may succeed.
714 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
718 #define G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "thumbnail::is-valid" /* boolean */
723 * G_FILE_ATTRIBUTE_PREVIEW_ICON:
725 * A key in the "preview" namespace for getting a #GIcon that can be
726 * used to get preview of the file. For example, it may be a low
727 * resolution thumbnail without metadata. Corresponding
728 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT. The value
729 * for this key should contain a #GIcon.
733 #define G_FILE_ATTRIBUTE_PREVIEW_ICON "preview::icon" /* object (GIcon) */
735 /* File system info (for g_file_get_filesystem_info) */
738 * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
740 * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
741 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
742 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
744 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
747 * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
749 * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
750 * file system. Corresponding #GFileAttributeType is
751 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
753 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
756 * G_FILE_ATTRIBUTE_FILESYSTEM_USED:
758 * A key in the "filesystem" namespace for getting the number of bytes of used on the
759 * file system. Corresponding #GFileAttributeType is
760 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
764 #define G_FILE_ATTRIBUTE_FILESYSTEM_USED "filesystem::used" /* uint64 */
767 * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
769 * A key in the "filesystem" namespace for getting the file system's type.
770 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
772 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
775 * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
777 * A key in the "filesystem" namespace for checking if the file system
778 * is read only. Is set to %TRUE if the file system is read only.
779 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
781 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
784 * G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW:
786 * A key in the "filesystem" namespace for hinting a file manager
787 * application whether it should preview (e.g. thumbnail) files on the
788 * file system. The value for this key contain a
789 * #GFilesystemPreviewType.
791 #define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview" /* uint32 (GFilesystemPreviewType) */
794 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
796 * A key in the "gvfs" namespace that gets the name of the current
797 * GVFS backend in use. Corresponding #GFileAttributeType is
798 * %G_FILE_ATTRIBUTE_TYPE_STRING.
800 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
803 * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
805 * A key in the "selinux" namespace for getting the file's SELinux
806 * context. Corresponding #GFileAttributeType is
807 * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
808 * available if GLib has been built with SELinux support.
810 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
813 * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
815 * A key in the "trash" namespace. When requested against
816 * "trash:///" returns the number of (toplevel) items in the trash folder.
817 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
819 #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count" /* uint32 */
822 * G_FILE_ATTRIBUTE_TRASH_ORIG_PATH:
824 * A key in the "trash" namespace. When requested against
825 * items in "trash:///", will return the original path to the file before it
826 * was trashed. Corresponding #GFileAttributeType is
827 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
831 #define G_FILE_ATTRIBUTE_TRASH_ORIG_PATH "trash::orig-path" /* byte string */
834 * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE:
836 * A key in the "trash" namespace. When requested against
837 * items in "trash:///", will return the date and time when the file
838 * was trashed. The format of the returned string is YYYY-MM-DDThh:mm:ss.
839 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
843 #define G_FILE_ATTRIBUTE_TRASH_DELETION_DATE "trash::deletion-date" /* string */
845 GLIB_AVAILABLE_IN_ALL
846 GType g_file_info_get_type (void) G_GNUC_CONST;
848 GLIB_AVAILABLE_IN_ALL
849 GFileInfo * g_file_info_new (void);
850 GLIB_AVAILABLE_IN_ALL
851 GFileInfo * g_file_info_dup (GFileInfo *other);
852 GLIB_AVAILABLE_IN_ALL
853 void g_file_info_copy_into (GFileInfo *src_info,
854 GFileInfo *dest_info);
855 GLIB_AVAILABLE_IN_ALL
856 gboolean g_file_info_has_attribute (GFileInfo *info,
857 const char *attribute);
858 GLIB_AVAILABLE_IN_ALL
859 gboolean g_file_info_has_namespace (GFileInfo *info,
860 const char *name_space);
861 GLIB_AVAILABLE_IN_ALL
862 char ** g_file_info_list_attributes (GFileInfo *info,
863 const char *name_space);
864 GLIB_AVAILABLE_IN_ALL
865 gboolean g_file_info_get_attribute_data (GFileInfo *info,
866 const char *attribute,
867 GFileAttributeType *type,
869 GFileAttributeStatus *status);
870 GLIB_AVAILABLE_IN_ALL
871 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
872 const char *attribute);
873 GLIB_AVAILABLE_IN_ALL
874 void g_file_info_remove_attribute (GFileInfo *info,
875 const char *attribute);
876 GLIB_AVAILABLE_IN_ALL
877 GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
878 const char *attribute);
879 GLIB_AVAILABLE_IN_ALL
880 gboolean g_file_info_set_attribute_status (GFileInfo *info,
881 const char *attribute,
882 GFileAttributeStatus status);
883 GLIB_AVAILABLE_IN_ALL
884 char * g_file_info_get_attribute_as_string (GFileInfo *info,
885 const char *attribute);
886 GLIB_AVAILABLE_IN_ALL
887 const char * g_file_info_get_attribute_string (GFileInfo *info,
888 const char *attribute);
889 GLIB_AVAILABLE_IN_ALL
890 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
891 const char *attribute);
892 GLIB_AVAILABLE_IN_ALL
893 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
894 const char *attribute);
895 GLIB_AVAILABLE_IN_ALL
896 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
897 const char *attribute);
898 GLIB_AVAILABLE_IN_ALL
899 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
900 const char *attribute);
901 GLIB_AVAILABLE_IN_ALL
902 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
903 const char *attribute);
904 GLIB_AVAILABLE_IN_ALL
905 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
906 const char *attribute);
907 GLIB_AVAILABLE_IN_ALL
908 GObject * g_file_info_get_attribute_object (GFileInfo *info,
909 const char *attribute);
910 GLIB_AVAILABLE_IN_ALL
911 char ** g_file_info_get_attribute_stringv (GFileInfo *info,
912 const char *attribute);
914 GLIB_AVAILABLE_IN_ALL
915 void g_file_info_set_attribute (GFileInfo *info,
916 const char *attribute,
917 GFileAttributeType type,
919 GLIB_AVAILABLE_IN_ALL
920 void g_file_info_set_attribute_string (GFileInfo *info,
921 const char *attribute,
922 const char *attr_value);
923 GLIB_AVAILABLE_IN_ALL
924 void g_file_info_set_attribute_byte_string (GFileInfo *info,
925 const char *attribute,
926 const char *attr_value);
927 GLIB_AVAILABLE_IN_ALL
928 void g_file_info_set_attribute_boolean (GFileInfo *info,
929 const char *attribute,
930 gboolean attr_value);
931 GLIB_AVAILABLE_IN_ALL
932 void g_file_info_set_attribute_uint32 (GFileInfo *info,
933 const char *attribute,
935 GLIB_AVAILABLE_IN_ALL
936 void g_file_info_set_attribute_int32 (GFileInfo *info,
937 const char *attribute,
939 GLIB_AVAILABLE_IN_ALL
940 void g_file_info_set_attribute_uint64 (GFileInfo *info,
941 const char *attribute,
943 GLIB_AVAILABLE_IN_ALL
944 void g_file_info_set_attribute_int64 (GFileInfo *info,
945 const char *attribute,
947 GLIB_AVAILABLE_IN_ALL
948 void g_file_info_set_attribute_object (GFileInfo *info,
949 const char *attribute,
950 GObject *attr_value);
951 GLIB_AVAILABLE_IN_ALL
952 void g_file_info_set_attribute_stringv (GFileInfo *info,
953 const char *attribute,
956 GLIB_AVAILABLE_IN_ALL
957 void g_file_info_clear_status (GFileInfo *info);
959 /* Helper getters: */
960 GLIB_AVAILABLE_IN_2_36
961 GDateTime * g_file_info_get_deletion_date (GFileInfo *info);
962 GLIB_AVAILABLE_IN_ALL
963 GFileType g_file_info_get_file_type (GFileInfo *info);
964 GLIB_AVAILABLE_IN_ALL
965 gboolean g_file_info_get_is_hidden (GFileInfo *info);
966 GLIB_AVAILABLE_IN_ALL
967 gboolean g_file_info_get_is_backup (GFileInfo *info);
968 GLIB_AVAILABLE_IN_ALL
969 gboolean g_file_info_get_is_symlink (GFileInfo *info);
970 GLIB_AVAILABLE_IN_ALL
971 const char * g_file_info_get_name (GFileInfo *info);
972 GLIB_AVAILABLE_IN_ALL
973 const char * g_file_info_get_display_name (GFileInfo *info);
974 GLIB_AVAILABLE_IN_ALL
975 const char * g_file_info_get_edit_name (GFileInfo *info);
976 GLIB_AVAILABLE_IN_ALL
977 GIcon * g_file_info_get_icon (GFileInfo *info);
978 GLIB_AVAILABLE_IN_ALL
979 GIcon * g_file_info_get_symbolic_icon (GFileInfo *info);
980 GLIB_AVAILABLE_IN_ALL
981 const char * g_file_info_get_content_type (GFileInfo *info);
982 GLIB_AVAILABLE_IN_ALL
983 goffset g_file_info_get_size (GFileInfo *info);
984 GLIB_AVAILABLE_IN_ALL
985 void g_file_info_get_modification_time (GFileInfo *info,
987 GLIB_AVAILABLE_IN_ALL
988 const char * g_file_info_get_symlink_target (GFileInfo *info);
989 GLIB_AVAILABLE_IN_ALL
990 const char * g_file_info_get_etag (GFileInfo *info);
991 GLIB_AVAILABLE_IN_ALL
992 gint32 g_file_info_get_sort_order (GFileInfo *info);
994 GLIB_AVAILABLE_IN_ALL
995 void g_file_info_set_attribute_mask (GFileInfo *info,
996 GFileAttributeMatcher *mask);
997 GLIB_AVAILABLE_IN_ALL
998 void g_file_info_unset_attribute_mask (GFileInfo *info);
1000 /* Helper setters: */
1001 GLIB_AVAILABLE_IN_ALL
1002 void g_file_info_set_file_type (GFileInfo *info,
1004 GLIB_AVAILABLE_IN_ALL
1005 void g_file_info_set_is_hidden (GFileInfo *info,
1006 gboolean is_hidden);
1007 GLIB_AVAILABLE_IN_ALL
1008 void g_file_info_set_is_symlink (GFileInfo *info,
1009 gboolean is_symlink);
1010 GLIB_AVAILABLE_IN_ALL
1011 void g_file_info_set_name (GFileInfo *info,
1013 GLIB_AVAILABLE_IN_ALL
1014 void g_file_info_set_display_name (GFileInfo *info,
1015 const char *display_name);
1016 GLIB_AVAILABLE_IN_ALL
1017 void g_file_info_set_edit_name (GFileInfo *info,
1018 const char *edit_name);
1019 GLIB_AVAILABLE_IN_ALL
1020 void g_file_info_set_icon (GFileInfo *info,
1022 GLIB_AVAILABLE_IN_ALL
1023 void g_file_info_set_symbolic_icon (GFileInfo *info,
1025 GLIB_AVAILABLE_IN_ALL
1026 void g_file_info_set_content_type (GFileInfo *info,
1027 const char *content_type);
1028 GLIB_AVAILABLE_IN_ALL
1029 void g_file_info_set_size (GFileInfo *info,
1031 GLIB_AVAILABLE_IN_ALL
1032 void g_file_info_set_modification_time (GFileInfo *info,
1034 GLIB_AVAILABLE_IN_ALL
1035 void g_file_info_set_symlink_target (GFileInfo *info,
1036 const char *symlink_target);
1037 GLIB_AVAILABLE_IN_ALL
1038 void g_file_info_set_sort_order (GFileInfo *info,
1041 #define G_TYPE_FILE_ATTRIBUTE_MATCHER (g_file_attribute_matcher_get_type ())
1042 GLIB_AVAILABLE_IN_ALL
1043 GType g_file_attribute_matcher_get_type (void) G_GNUC_CONST;
1045 GLIB_AVAILABLE_IN_ALL
1046 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
1047 GLIB_AVAILABLE_IN_ALL
1048 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
1049 GLIB_AVAILABLE_IN_ALL
1050 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
1051 GLIB_AVAILABLE_IN_ALL
1052 GFileAttributeMatcher *g_file_attribute_matcher_subtract (GFileAttributeMatcher *matcher,
1053 GFileAttributeMatcher *subtract);
1054 GLIB_AVAILABLE_IN_ALL
1055 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
1056 const char *attribute);
1057 GLIB_AVAILABLE_IN_ALL
1058 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
1059 const char *attribute);
1060 GLIB_AVAILABLE_IN_ALL
1061 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
1063 GLIB_AVAILABLE_IN_ALL
1064 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
1065 GLIB_AVAILABLE_IN_2_32
1066 char * g_file_attribute_matcher_to_string (GFileAttributeMatcher *matcher);
1070 #endif /* __G_FILE_INFO_H__ */