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_DESCRIPTION:
179 * A key in the "standard" namespace for getting the description of the file.
180 * The description is a utf8 string that describes the file, generally containing
181 * the filename, but can also contain furter information. Example descriptions
182 * could be "filename (on hostname)" for a remote file or "filename (in trash)"
183 * for a file in the trash. This is useful for instance as the window title
184 * when displaying a directory or for a bookmarks menu.
186 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
188 #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description" /* string */
191 * G_FILE_ATTRIBUTE_STANDARD_ICON:
193 * A key in the "standard" namespace for getting the icon for the file.
194 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
195 * The value for this key should contain a #GIcon.
197 #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon" /* object (GIcon) */
200 * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
202 * A key in the "standard" namespace for getting the content type of the file.
203 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
204 * The value for this key should contain a valid content type.
206 #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
209 * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
211 * A key in the "standard" namespace for getting the fast content type.
212 * The fast content type isn't as reliable as the regular one, as it
213 * only uses the filename to guess it, but it is faster to calculate than the
214 * regular content type.
215 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
218 #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
221 * G_FILE_ATTRIBUTE_STANDARD_SIZE:
223 * A key in the "standard" namespace for getting the file's size (in bytes).
224 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
226 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
229 * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
231 * A key in the "standard" namespace for getting the symlink target, if the file
232 * is a symlink. Corresponding #GFileAttributeType is
233 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
235 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
238 * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
240 * A key in the "standard" namespace for getting the target URI for the file, in
241 * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
242 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
244 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri" /* string */
247 * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
249 * A key in the "standard" namespace for setting the sort order of a file.
250 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
251 * An example use would be in file managers, which would use this key
252 * to set the order files are displayed. Files with smaller sort order
253 * should be sorted first, and files without sort order as if sort order
256 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order" /* int32 */
258 /* Entity tags, used to avoid missing updates on save */
261 * G_FILE_ATTRIBUTE_ETAG_VALUE:
263 * A key in the "etag" namespace for getting the value of the file's
264 * entity tag. Corresponding #GFileAttributeType is
265 * %G_FILE_ATTRIBUTE_TYPE_STRING.
267 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
269 /* File identifier, for e.g. avoiding loops when doing recursive
274 * G_FILE_ATTRIBUTE_ID_FILE:
276 * A key in the "id" namespace for getting a file identifier.
277 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
278 * An example use would be during listing files, to avoid recursive
279 * directory scanning.
281 #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
284 * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
286 * A key in the "id" namespace for getting the file system identifier.
287 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
288 * An example use would be during drag and drop to see if the source
289 * and target are on the same filesystem (default to move) or not (default
292 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
294 /* Calculated Access Rights for current user */
297 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
299 * A key in the "access" namespace for getting read privileges.
300 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
301 * This attribute will be %TRUE if the user is able to read the file.
303 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
306 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
308 * A key in the "access" namespace for getting write privileges.
309 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
310 * This attribute will be %TRUE if the user is able to write to the file.
312 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
315 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
317 * A key in the "access" namespace for getting execution privileges.
318 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
319 * This attribute will be %TRUE if the user is able to execute the file.
321 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
324 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
326 * A key in the "access" namespace for checking deletion privileges.
327 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
328 * This attribute will be %TRUE if the user is able to delete the file.
330 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
333 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
335 * A key in the "access" namespace for checking trashing privileges.
336 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
337 * This attribute will be %TRUE if the user is able to move the file to
340 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
343 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
345 * A key in the "access" namespace for checking renaming privileges.
346 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
347 * This attribute will be %TRUE if the user is able to rename the file.
349 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
351 /* TODO: Should we have special version for directories? can_enumerate, etc */
353 /* Mountable attributes */
356 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
358 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
359 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
361 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
364 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
366 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
367 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
369 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
372 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
374 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
375 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
377 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
380 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
382 * A key in the "mountable" namespace for getting the unix device.
383 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
385 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
388 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
390 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
391 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
393 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
395 /* Time attributes */
398 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
400 * A key in the "time" namespace for getting the time the file was last
401 * modified. Corresponding #GFileAttributeType is
402 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
405 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
408 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
410 * A key in the "time" namespace for getting the milliseconds of the time
411 * the file was last modified. This should be used in conjunction with
412 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
413 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
415 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
418 * G_FILE_ATTRIBUTE_TIME_ACCESS:
420 * A key in the "time" namespace for getting the time the file was last
421 * accessed. Corresponding #GFileAttributeType is
422 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
423 * file was last accessed.
425 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
428 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
430 * A key in the "time" namespace for getting the milliseconds of the time
431 * the file was last accessed. This should be used in conjunction with
432 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
433 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
435 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
438 * G_FILE_ATTRIBUTE_TIME_CHANGED:
440 * A key in the "time" namespace for getting the time the file was last
441 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
442 * and contains the UNIX time since the file was last changed.
444 * This corresponds to the traditional UNIX ctime.
446 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
449 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
451 * A key in the "time" namespace for getting the milliseconds of the time
452 * the file was last changed. This should be used in conjunction with
453 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
454 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
456 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
459 * G_FILE_ATTRIBUTE_TIME_CREATED:
461 * A key in the "time" namespace for getting the time the file was created.
462 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
463 * and contains the UNIX time since the file was created.
465 * This corresponds to the NTFS ctime.
467 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
470 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
472 * A key in the "time" namespace for getting the milliseconds of the time
473 * the file was created. This should be used in conjunction with
474 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
475 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
477 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
479 /* Unix specific attributes */
482 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
484 * A key in the "unix" namespace for getting the device id of the device the
485 * file is located on (see stat() documentation). This attribute is only
486 * available for UNIX file systems. Corresponding #GFileAttributeType is
487 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
489 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
492 * G_FILE_ATTRIBUTE_UNIX_INODE:
494 * A key in the "unix" namespace for getting the inode of the file.
495 * This attribute is only available for UNIX file systems. Corresponding
496 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
498 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
501 * G_FILE_ATTRIBUTE_UNIX_MODE:
503 * A key in the "unix" namespace for getting the mode of the file
504 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
505 * documentation. This attribute is only available for UNIX file systems.
506 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
508 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
511 * G_FILE_ATTRIBUTE_UNIX_NLINK:
513 * A key in the "unix" namespace for getting the number of hard links
514 * for a file. See lstat() documentation. This attribute is only available
515 * for UNIX file systems. Corresponding #GFileAttributeType is
516 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
518 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
521 * G_FILE_ATTRIBUTE_UNIX_UID:
523 * A key in the "unix" namespace for getting the user ID for the file.
524 * This attribute is only available for UNIX file systems.
525 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
527 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
530 * G_FILE_ATTRIBUTE_UNIX_GID:
532 * A key in the "unix" namespace for getting the group ID for the file.
533 * This attribute is only available for UNIX file systems.
534 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
536 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
539 * G_FILE_ATTRIBUTE_UNIX_RDEV:
541 * A key in the "unix" namespace for getting the device ID for the file
542 * (if it is a special file). See lstat() documentation. This attribute
543 * is only available for UNIX file systems. Corresponding #GFileAttributeType
544 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
546 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
549 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
551 * A key in the "unix" namespace for getting the block size for the file
552 * system. This attribute is only available for UNIX file systems.
553 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
555 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
558 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
560 * A key in the "unix" namespace for getting the number of blocks allocated
561 * for the file. This attribute is only available for UNIX file systems.
562 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
564 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
567 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
569 * A key in the "unix" namespace for checking if the file represents a
570 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
571 * point. This attribute is only available for UNIX file systems.
572 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
574 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
576 /* DOS specific attributes */
579 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
581 * A key in the "dos" namespace for checking if the file's archive flag
582 * is set. This attribute is %TRUE if the archive flag is set. This attribute
583 * is only available for DOS file systems. Corresponding #GFileAttributeType
584 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
586 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
589 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
591 * A key in the "dos" namespace for checking if the file's backup flag
592 * is set. This attribute is %TRUE if the backup flag is set. This attribute
593 * is only available for DOS file systems. Corresponding #GFileAttributeType
594 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
596 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
598 /* Owner attributes */
601 * G_FILE_ATTRIBUTE_OWNER_USER:
603 * A key in the "owner" namespace for getting the user name of the
604 * file's owner. Corresponding #GFileAttributeType is
605 * %G_FILE_ATTRIBUTE_TYPE_STRING.
607 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
610 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
612 * A key in the "owner" namespace for getting the real name of the
613 * user that owns the file. Corresponding #GFileAttributeType is
614 * %G_FILE_ATTRIBUTE_TYPE_STRING.
616 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
619 * G_FILE_ATTRIBUTE_OWNER_GROUP:
621 * A key in the "owner" namespace for getting the file owner's group.
622 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
624 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
629 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
631 * A key in the "thumbnail" namespace for getting the path to the thumbnail
632 * image. Corresponding #GFileAttributeType is
633 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
635 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
637 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
639 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
640 * This attribute is %TRUE if thumbnailing failed. Corresponding
641 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
643 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
645 /* File system info (for g_file_get_filesystem_info) */
648 * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
650 * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
651 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
652 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
654 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
657 * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
659 * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
660 * file system. Corresponding #GFileAttributeType is
661 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
663 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
666 * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
668 * A key in the "filesystem" namespace for getting the file system's type.
669 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
671 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
674 * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
676 * A key in the "filesystem" namespace for checking if the file system
677 * is read only. Is set to %TRUE if the file system is read only.
678 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
680 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
683 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
685 * A key in the "gvfs" namespace that gets the name of the current
686 * GVFS backend in use. Corresponding #GFileAttributeType is
687 * %G_FILE_ATTRIBUTE_TYPE_STRING.
689 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
692 * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
694 * A key in the "selinux" namespace for getting the file's SELinux
695 * context. Corresponding #GFileAttributeType is
696 * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
697 * available if GLib has been built with SELinux support.
699 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
702 * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
704 * A key in the "trash" namespace. When requested against 'trash:///'
705 * returns the number of (toplevel) items in the trash folder.
706 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
708 #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count" /* uint32 */
710 GType g_file_info_get_type (void) G_GNUC_CONST;
712 GFileInfo * g_file_info_new (void);
713 GFileInfo * g_file_info_dup (GFileInfo *other);
714 void g_file_info_copy_into (GFileInfo *src_info,
715 GFileInfo *dest_info);
716 gboolean g_file_info_has_attribute (GFileInfo *info,
717 const char *attribute);
718 char ** g_file_info_list_attributes (GFileInfo *info,
719 const char *name_space);
720 gboolean g_file_info_get_attribute_data (GFileInfo *info,
721 const char *attribute,
722 GFileAttributeType *type,
724 GFileAttributeStatus *status);
725 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
726 const char *attribute);
727 void g_file_info_remove_attribute (GFileInfo *info,
728 const char *attribute);
729 GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
730 const char *attribute);
731 char * g_file_info_get_attribute_as_string (GFileInfo *info,
732 const char *attribute);
733 const char * g_file_info_get_attribute_string (GFileInfo *info,
734 const char *attribute);
735 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
736 const char *attribute);
737 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
738 const char *attribute);
739 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
740 const char *attribute);
741 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
742 const char *attribute);
743 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
744 const char *attribute);
745 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
746 const char *attribute);
747 GObject * g_file_info_get_attribute_object (GFileInfo *info,
748 const char *attribute);
750 void g_file_info_set_attribute (GFileInfo *info,
751 const char *attribute,
752 GFileAttributeType type,
754 void g_file_info_set_attribute_string (GFileInfo *info,
755 const char *attribute,
756 const char *attr_value);
757 void g_file_info_set_attribute_byte_string (GFileInfo *info,
758 const char *attribute,
759 const char *attr_value);
760 void g_file_info_set_attribute_boolean (GFileInfo *info,
761 const char *attribute,
762 gboolean attr_value);
763 void g_file_info_set_attribute_uint32 (GFileInfo *info,
764 const char *attribute,
766 void g_file_info_set_attribute_int32 (GFileInfo *info,
767 const char *attribute,
769 void g_file_info_set_attribute_uint64 (GFileInfo *info,
770 const char *attribute,
772 void g_file_info_set_attribute_int64 (GFileInfo *info,
773 const char *attribute,
775 void g_file_info_set_attribute_object (GFileInfo *info,
776 const char *attribute,
777 GObject *attr_value);
779 void g_file_info_clear_status (GFileInfo *info);
781 /* Helper getters: */
782 GFileType g_file_info_get_file_type (GFileInfo *info);
783 gboolean g_file_info_get_is_hidden (GFileInfo *info);
784 gboolean g_file_info_get_is_backup (GFileInfo *info);
785 gboolean g_file_info_get_is_symlink (GFileInfo *info);
786 const char * g_file_info_get_name (GFileInfo *info);
787 const char * g_file_info_get_display_name (GFileInfo *info);
788 const char * g_file_info_get_edit_name (GFileInfo *info);
789 GIcon * g_file_info_get_icon (GFileInfo *info);
790 const char * g_file_info_get_content_type (GFileInfo *info);
791 goffset g_file_info_get_size (GFileInfo *info);
792 void g_file_info_get_modification_time (GFileInfo *info,
794 const char * g_file_info_get_symlink_target (GFileInfo *info);
795 const char * g_file_info_get_etag (GFileInfo *info);
796 gint32 g_file_info_get_sort_order (GFileInfo *info);
798 void g_file_info_set_attribute_mask (GFileInfo *info,
799 GFileAttributeMatcher *mask);
800 void g_file_info_unset_attribute_mask (GFileInfo *info);
802 /* Helper setters: */
803 void g_file_info_set_file_type (GFileInfo *info,
805 void g_file_info_set_is_hidden (GFileInfo *info,
807 void g_file_info_set_is_symlink (GFileInfo *info,
808 gboolean is_symlink);
809 void g_file_info_set_name (GFileInfo *info,
811 void g_file_info_set_display_name (GFileInfo *info,
812 const char *display_name);
813 void g_file_info_set_edit_name (GFileInfo *info,
814 const char *edit_name);
815 void g_file_info_set_icon (GFileInfo *info,
817 void g_file_info_set_content_type (GFileInfo *info,
818 const char *content_type);
819 void g_file_info_set_size (GFileInfo *info,
821 void g_file_info_set_modification_time (GFileInfo *info,
823 void g_file_info_set_symlink_target (GFileInfo *info,
824 const char *symlink_target);
825 void g_file_info_set_sort_order (GFileInfo *info,
828 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
829 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
830 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
831 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
832 const char *attribute);
833 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
834 const char *attribute);
835 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
837 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
842 #endif /* __G_FILE_INFO_H__ */