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 #ifndef __G_FILE_INFO_H__
24 #define __G_FILE_INFO_H__
26 #include <glib-object.h>
27 #include <glib/gfileutils.h>
28 #include <gio/gfileattribute.h>
29 #include <gio/gicon.h>
33 #define G_TYPE_FILE_INFO (g_file_info_get_type ())
34 #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
35 #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
36 #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
37 #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
38 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
43 * Stores information about a file system object referenced by a #GFile.
45 typedef struct _GFileInfo GFileInfo;
46 typedef struct _GFileInfoClass GFileInfoClass;
49 * GFileAttributeMatcher:
51 * Determines if a string matches a file attribute.
53 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
57 * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
58 * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
59 * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
60 * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link
62 * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo,
63 * block device, or character device.
64 * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems).
65 * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
67 * Indicates the file's on-disk type.
70 G_FILE_TYPE_UNKNOWN = 0,
72 G_FILE_TYPE_DIRECTORY,
73 G_FILE_TYPE_SYMBOLIC_LINK,
74 G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
79 /* Common Attributes: */
81 * G_FILE_ATTRIBUTE_STD_TYPE:
83 * A key in the "std" namespace for storing file types.
84 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
85 * The value for this key should contain a #GFileType.
87 #define G_FILE_ATTRIBUTE_STD_TYPE "std::type" /* uint32 (GFileType) */
90 * G_FILE_ATTRIBUTE_STD_IS_HIDDEN:
92 * A key in the "std" namespace for checking if a file is hidden.
93 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
95 #define G_FILE_ATTRIBUTE_STD_IS_HIDDEN "std::is-hidden" /* boolean */
98 * G_FILE_ATTRIBUTE_STD_IS_BACKUP:
100 * A key in the "std" namespace for checking if a file is a backup file.
101 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
103 #define G_FILE_ATTRIBUTE_STD_IS_BACKUP "std::is-backup" /* boolean */
106 * G_FILE_ATTRIBUTE_STD_IS_SYMLINK:
108 * A key in the "std" namespace for checking if the file is a symlink.
109 * Typically the actual type is something else, if we followed the symlink
111 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
113 #define G_FILE_ATTRIBUTE_STD_IS_SYMLINK "std::is-symlink" /* boolean */
116 * G_FILE_ATTRIBUTE_STD_IS_VIRTUAL:
118 * A key in the "std" namespace for checking if a file is virtual.
119 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
121 #define G_FILE_ATTRIBUTE_STD_IS_VIRTUAL "std::is-virtual" /* boolean */
124 * G_FILE_ATTRIBUTE_STD_NAME:
126 * A key in the "std" namespace for getting the name of the file.
127 * The name is the on-disk filename which may not be in any known encoding,
128 * and can thus not be generally displayed as is.
129 * Use #G_FILE_ATTRIBUTE_STD_DISPLAY_NAME if you need to display the
130 * name in a user interface.
131 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
133 #define G_FILE_ATTRIBUTE_STD_NAME "std::name" /* byte string */
136 * G_FILE_ATTRIBUTE_STD_DISPLAY_NAME:
138 * A key in the "std" namespace for getting the display name of the file.
139 * A display name is guaranteed to be in UTF8 and can thus be displayed in
141 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
143 #define G_FILE_ATTRIBUTE_STD_DISPLAY_NAME "std::display-name" /* string */
146 * G_FILE_ATTRIBUTE_STD_EDIT_NAME:
148 * A key in the "std" namespace for edit name of the file.
149 * An edit name is similar to the display name, but it is meant to be
150 * used when you want to rename the file in the UI. The display name
151 * might contain information you don't want in the new filename (such as
152 * "(invalid unicode)" if the filename was in an invalid encoding).
154 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
156 #define G_FILE_ATTRIBUTE_STD_EDIT_NAME "std::edit-name" /* string */
159 * G_FILE_ATTRIBUTE_STD_COPY_NAME:
161 * A key in the "std" namespace for getting the copy name of the file.
162 * The copy name is an optional version of the name. If availible its always
163 * in UTF8, and corresponds directly to the original filename (only transcoded to
164 * UTF8). This is useful if you want to copy the file to another filesystem that
165 * might have a different encoding. If the filename is not a valid string in the
166 * encoding selected for the filesystem it is in then the copy name will not be set.
168 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
170 #define G_FILE_ATTRIBUTE_STD_COPY_NAME "std::copy-name" /* string */
173 * G_FILE_ATTRIBUTE_STD_ICON:
175 * A key in the "std" namespace for getting the icon for the file.
176 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
177 * The value for this key should contain a #GIcon.
179 #define G_FILE_ATTRIBUTE_STD_ICON "std::icon" /* object (GIcon) */
182 * G_FILE_ATTRIBUTE_STD_CONTENT_TYPE:
184 * A key in the "std" namespace for getting the content type of the file.
185 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
186 * The value for this key should contain a valid content type.
188 #define G_FILE_ATTRIBUTE_STD_CONTENT_TYPE "std::content-type" /* string */
191 * G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE:
193 * A key in the "std" namespace for getting the fast content type.
194 * The fast content type isn't as reliable as the regular one, as it
195 * only uses the filename to guess it, but it is faster to calculate than the
196 * regular content type.
197 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
200 #define G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE "std::fast-content-type" /* string */
203 * G_FILE_ATTRIBUTE_STD_SIZE:
205 * A key in the "std" namespace for getting the file's size (in bytes).
206 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
208 #define G_FILE_ATTRIBUTE_STD_SIZE "std::size" /* uint64 */
211 * G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET:
213 * A key in the "std" namespace for getting the symlink target, if the file
214 * is a symlink. Corresponding #GFileAttributeType is
215 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
217 #define G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET "std::symlink-target" /* byte string */
220 * G_FILE_ATTRIBUTE_STD_TARGET_URI:
222 * A key in the "std" namespace for getting the target URI for the file, in
223 * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
224 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
226 #define G_FILE_ATTRIBUTE_STD_TARGET_URI "std::target-uri" /* string */
229 * G_FILE_ATTRIBUTE_STD_SORT_ORDER:
231 * A key in the "std" namespace for setting the sort order of a file.
232 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
233 * An example use would be in file managers, which would use this key
234 * to set the order files are displayed. Files with smaller sort order
235 * should be sorted first, and files without sort order as if sort order
238 #define G_FILE_ATTRIBUTE_STD_SORT_ORDER "std::sort-order" /* int32 */
240 /* Entity tags, used to avoid missing updates on save */
243 * G_FILE_ATTRIBUTE_ETAG_VALUE:
245 * A key in the "etag" namespace for getting the value of the file's
246 * entity tag. Corresponding #GFileAttributeType is
247 * %G_FILE_ATTRIBUTE_TYPE_STRING.
249 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
251 /* File identifier, for e.g. avoiding loops when doing recursive
256 * G_FILE_ATTRIBUTE_ID_FILE:
258 * A key in the "id" namespace for getting a file identifier.
259 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
260 * An example use would be during listing files, to avoid recursive
261 * directory scanning.
263 #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
266 * G_FILE_ATTRIBUTE_ID_FS:
268 * A key in the "id" namespace for getting the file system identifier.
269 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
270 * An example use would be during listing files, to avoid recursive
271 * directory scanning.
273 #define G_FILE_ATTRIBUTE_ID_FS "id::fs" /* string */
275 /* Calculated Access Rights for current user */
278 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
280 * A key in the "access" namespace for getting read privileges.
281 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
282 * This attribute will be %TRUE if the user is able to read the file.
284 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
287 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
289 * A key in the "access" namespace for getting write privileges.
290 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
291 * This attribute will be %TRUE if the user is able to write to the file.
293 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
296 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
298 * A key in the "access" namespace for getting execution privileges.
299 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
300 * This attribute will be %TRUE if the user is able to execute the file.
302 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
305 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
307 * A key in the "access" namespace for checking deletion privileges.
308 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
309 * This attribute will be %TRUE if the user is able to delete the file.
311 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
314 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
316 * A key in the "access" namespace for checking trashing privileges.
317 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
318 * This attribute will be %TRUE if the user is able to move the file to
321 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
324 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
326 * A key in the "access" namespace for checking renaming privileges.
327 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
328 * This attribute will be %TRUE if the user is able to rename the file.
330 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
332 /* TODO: Should we have special version for directories? can_enumerate, etc */
334 /* Mountable attributes */
337 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
339 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
340 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
342 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
345 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
347 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
348 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
350 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
353 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
355 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
356 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
358 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
361 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
363 * A key in the "mountable" namespace for getting the unix device.
364 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
366 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
369 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
371 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
372 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
374 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
376 /* Time attributes */
379 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
381 * A key in the "time" namespace for getting the time the file was last
382 * modified. Corresponding #GFileAttributeType is
383 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
386 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
389 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
391 * A key in the "time" namespace for getting the milliseconds of the time
392 * the file was last modified. This should be used in conjunction with
393 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
394 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
396 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
399 * G_FILE_ATTRIBUTE_TIME_ACCESS:
401 * A key in the "time" namespace for getting the time the file was last
402 * accessed. Corresponding #GFileAttributeType is
403 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
404 * file was last accessed.
406 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
409 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
411 * A key in the "time" namespace for getting the milliseconds of the time
412 * the file was last accessed. This should be used in conjunction with
413 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
414 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
416 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
419 * G_FILE_ATTRIBUTE_TIME_CHANGED:
421 * A key in the "time" namespace for getting the time the file was last
422 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
423 * and contains the UNIX time since the file was last changed.
425 * This corresponds to the traditional UNIX ctime.
427 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
430 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
432 * A key in the "time" namespace for getting the milliseconds of the time
433 * the file was last changed. This should be used in conjunction with
434 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
435 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
437 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
440 * G_FILE_ATTRIBUTE_TIME_CREATED:
442 * A key in the "time" namespace for getting the time the file was created.
443 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
444 * and contains the UNIX time since the file was created.
446 * This corresponds to the NTFS ctime.
448 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
451 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
453 * A key in the "time" namespace for getting the milliseconds of the time
454 * the file was created. This should be used in conjunction with
455 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
456 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
458 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
460 /* Unix specific attributes */
463 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
465 * A key in the "unix" namespace for getting the device id of the device the
466 * file is located on (see stat() documentation). This attribute is only
467 * available for UNIX file systems. Corresponding #GFileAttributeType is
468 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
470 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
473 * G_FILE_ATTRIBUTE_UNIX_INODE:
475 * A key in the "unix" namespace for getting the inode of the file.
476 * This attribute is only available for UNIX file systems. Corresponding
477 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
479 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
482 * G_FILE_ATTRIBUTE_UNIX_MODE:
484 * A key in the "unix" namespace for getting the mode of the file
485 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
486 * documentation. This attribute is only available for UNIX file systems.
487 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
489 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
492 * G_FILE_ATTRIBUTE_UNIX_NLINK:
494 * A key in the "unix" namespace for getting the number of hard links
495 * for a file. See lstat() documentation. This attribute is only available
496 * for UNIX file systems. Corresponding #GFileAttributeType is
497 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
499 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
502 * G_FILE_ATTRIBUTE_UNIX_UID:
504 * A key in the "unix" namespace for getting the user ID for the file.
505 * This attribute is only available for UNIX file systems.
506 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
508 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
511 * G_FILE_ATTRIBUTE_UNIX_GID:
513 * A key in the "unix" namespace for getting the group ID for the file.
514 * This attribute is only available for UNIX file systems.
515 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
517 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
520 * G_FILE_ATTRIBUTE_UNIX_RDEV:
522 * A key in the "unix" namespace for getting the device ID for the file
523 * (if it is a special file). See lstat() documentation. This attribute
524 * is only available for UNIX file systems. Corresponding #GFileAttributeType
525 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
527 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
530 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
532 * A key in the "unix" namespace for getting the block size for the file
533 * system. This attribute is only available for UNIX file systems.
534 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
536 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
539 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
541 * A key in the "unix" namespace for getting the number of blocks allocated
542 * for the file. This attribute is only available for UNIX file systems.
543 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
545 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
548 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
550 * A key in the "unix" namespace for checking if the file represents a
551 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
552 * point. This attribute is only available for UNIX file systems.
553 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
555 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
557 /* DOS specific attributes */
560 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
562 * A key in the "dos" namespace for checking if the file's archive flag
563 * is set. This attribute is %TRUE if the archive flag is set. This attribute
564 * is only available for DOS file systems. Corresponding #GFileAttributeType
565 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
567 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
570 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
572 * A key in the "dos" namespace for checking if the file's backup flag
573 * is set. This attribute is %TRUE if the backup flag is set. This attribute
574 * is only available for DOS file systems. Corresponding #GFileAttributeType
575 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
577 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
579 /* Owner attributes */
582 * G_FILE_ATTRIBUTE_OWNER_USER:
584 * A key in the "owner" namespace for getting the user name of the
585 * file's owner. Corresponding #GFileAttributeType is
586 * %G_FILE_ATTRIBUTE_TYPE_STRING.
588 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
591 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
593 * A key in the "owner" namespace for getting the real name of the
594 * user that owns the file. Corresponding #GFileAttributeType is
595 * %G_FILE_ATTRIBUTE_TYPE_STRING.
597 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
600 * G_FILE_ATTRIBUTE_OWNER_GROUP:
602 * A key in the "owner" namespace for getting the file owner's group.
603 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
605 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
610 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
612 * A key in the "thumbnail" namespace for getting the path to the thumbnail
613 * image. Corresponding #GFileAttributeType is
614 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
616 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
618 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
620 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
621 * This attribute is %TRUE if thumbnailing failed. Corresponding
622 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
624 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
626 /* File system info (for g_file_get_filesystem_info) */
629 * G_FILE_ATTRIBUTE_FS_SIZE:
631 * A key in the "fs" namespace for getting the total size (in bytes) of the file system,
632 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
633 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
635 #define G_FILE_ATTRIBUTE_FS_SIZE "fs::size" /* uint64 */
638 * G_FILE_ATTRIBUTE_FS_FREE:
640 * A key in the "fs" namespace for getting the number of bytes of free space left on the
641 * file system. Corresponding #GFileAttributeType is
642 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
644 #define G_FILE_ATTRIBUTE_FS_FREE "fs::free" /* uint64 */
647 * G_FILE_ATTRIBUTE_FS_TYPE:
649 * A key in the "fs" namespace for getting the file system's type.
650 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
652 #define G_FILE_ATTRIBUTE_FS_TYPE "fs::type" /* string */
655 * G_FILE_ATTRIBUTE_FS_READONLY:
657 * A key in the "fs" namespace for checking if the file system is read only.
658 * Is set to %TRUE if the file system is read only. Corresponding
659 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
661 #define G_FILE_ATTRIBUTE_FS_READONLY "fs::readonly" /* boolean */
664 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
666 * A key in the "gvfs" namespace that gets the name of the current
667 * GVFS backend in use. Corresponding #GFileAttributeType is
668 * %G_FILE_ATTRIBUTE_TYPE_STRING.
670 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
672 GType g_file_info_get_type (void) G_GNUC_CONST;
674 GFileInfo * g_file_info_new (void);
675 GFileInfo * g_file_info_dup (GFileInfo *other);
676 void g_file_info_copy_into (GFileInfo *src_info,
677 GFileInfo *dest_info);
678 gboolean g_file_info_has_attribute (GFileInfo *info,
679 const char *attribute);
680 char ** g_file_info_list_attributes (GFileInfo *info,
681 const char *name_space);
682 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
683 const char *attribute);
684 void g_file_info_remove_attribute (GFileInfo *info,
685 const char *attribute);
686 GFileAttributeValue * g_file_info_get_attribute (GFileInfo *info,
687 const char *attribute);
688 const char * g_file_info_get_attribute_string (GFileInfo *info,
689 const char *attribute);
690 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
691 const char *attribute);
692 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
693 const char *attribute);
694 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
695 const char *attribute);
696 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
697 const char *attribute);
698 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
699 const char *attribute);
700 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
701 const char *attribute);
702 GObject * g_file_info_get_attribute_object (GFileInfo *info,
703 const char *attribute);
705 void g_file_info_set_attribute (GFileInfo *info,
706 const char *attribute,
707 const GFileAttributeValue *attr_value);
708 void g_file_info_set_attribute_string (GFileInfo *info,
709 const char *attribute,
710 const char *attr_value);
711 void g_file_info_set_attribute_byte_string (GFileInfo *info,
712 const char *attribute,
713 const char *attr_value);
714 void g_file_info_set_attribute_boolean (GFileInfo *info,
715 const char *attribute,
716 gboolean attr_value);
717 void g_file_info_set_attribute_uint32 (GFileInfo *info,
718 const char *attribute,
720 void g_file_info_set_attribute_int32 (GFileInfo *info,
721 const char *attribute,
723 void g_file_info_set_attribute_uint64 (GFileInfo *info,
724 const char *attribute,
726 void g_file_info_set_attribute_int64 (GFileInfo *info,
727 const char *attribute,
729 void g_file_info_set_attribute_object (GFileInfo *info,
730 const char *attribute,
731 GObject *attr_value);
733 void g_file_info_clear_status (GFileInfo *info);
735 /* Helper getters: */
736 GFileType g_file_info_get_file_type (GFileInfo *info);
737 gboolean g_file_info_get_is_hidden (GFileInfo *info);
738 gboolean g_file_info_get_is_backup (GFileInfo *info);
739 gboolean g_file_info_get_is_symlink (GFileInfo *info);
740 const char * g_file_info_get_name (GFileInfo *info);
741 const char * g_file_info_get_display_name (GFileInfo *info);
742 const char * g_file_info_get_edit_name (GFileInfo *info);
743 GIcon * g_file_info_get_icon (GFileInfo *info);
744 const char * g_file_info_get_content_type (GFileInfo *info);
745 goffset g_file_info_get_size (GFileInfo *info);
746 void g_file_info_get_modification_time (GFileInfo *info,
748 const char * g_file_info_get_symlink_target (GFileInfo *info);
749 const char * g_file_info_get_etag (GFileInfo *info);
750 gint32 g_file_info_get_sort_order (GFileInfo *info);
752 void g_file_info_set_attribute_mask (GFileInfo *info,
753 GFileAttributeMatcher *mask);
754 void g_file_info_unset_attribute_mask (GFileInfo *info);
756 /* Helper setters: */
757 void g_file_info_set_file_type (GFileInfo *info,
759 void g_file_info_set_is_hidden (GFileInfo *info,
761 void g_file_info_set_is_symlink (GFileInfo *info,
762 gboolean is_symlink);
763 void g_file_info_set_name (GFileInfo *info,
765 void g_file_info_set_display_name (GFileInfo *info,
766 const char *display_name);
767 void g_file_info_set_edit_name (GFileInfo *info,
768 const char *edit_name);
769 void g_file_info_set_icon (GFileInfo *info,
771 void g_file_info_set_content_type (GFileInfo *info,
772 const char *content_type);
773 void g_file_info_set_size (GFileInfo *info,
775 void g_file_info_set_modification_time (GFileInfo *info,
777 void g_file_info_set_symlink_target (GFileInfo *info,
778 const char *symlink_target);
779 void g_file_info_set_sort_order (GFileInfo *info,
782 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
783 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
784 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
785 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
786 const char *attribute);
787 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
788 const char *attribute);
789 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
791 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
796 #endif /* __G_FILE_INFO_H__ */