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 */
84 * GFilesystemPreviewType:
85 * @G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS: Only preview files if user has explicitly requested it.
86 * @G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL: Preview files if user has requested preview of "local" files.
87 * @G_FILESYSTEM_PREVIEW_TYPE_NEVER: Never preview files.
89 * Indicates a hint from the file system whether files should be
90 * previewed in a file manager. Returned as the value of the key
91 * #G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW.
94 G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS = 0,
95 G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL,
96 G_FILESYSTEM_PREVIEW_TYPE_NEVER
97 } GFilesystemPreviewType;
99 /* Common Attributes: */
101 * G_FILE_ATTRIBUTE_STANDARD_TYPE:
103 * A key in the "standard" namespace for storing file types.
104 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
105 * The value for this key should contain a #GFileType.
107 #define G_FILE_ATTRIBUTE_STANDARD_TYPE "standard::type" /* uint32 (GFileType) */
110 * G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN:
112 * A key in the "standard" namespace for checking if a file is hidden.
113 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
115 #define G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "standard::is-hidden" /* boolean */
118 * G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP:
120 * A key in the "standard" namespace for checking if a file is a backup file.
121 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
123 #define G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP "standard::is-backup" /* boolean */
126 * G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK:
128 * A key in the "standard" namespace for checking if the file is a symlink.
129 * Typically the actual type is something else, if we followed the symlink
131 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
133 #define G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK "standard::is-symlink" /* boolean */
136 * G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL:
138 * A key in the "standard" namespace for checking if a file is virtual.
139 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
141 #define G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL "standard::is-virtual" /* boolean */
144 * G_FILE_ATTRIBUTE_STANDARD_NAME:
146 * A key in the "standard" namespace for getting the name of the file.
147 * The name is the on-disk filename which may not be in any known encoding,
148 * and can thus not be generally displayed as is.
149 * Use #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME if you need to display the
150 * name in a user interface.
151 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
153 #define G_FILE_ATTRIBUTE_STANDARD_NAME "standard::name" /* byte string */
156 * G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME:
158 * A key in the "standard" namespace for getting the display name of the file.
159 * A display name is guaranteed to be in UTF8 and can thus be displayed in
161 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
163 #define G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "standard::display-name" /* string */
166 * G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME:
168 * A key in the "standard" namespace for edit name of the file.
169 * An edit name is similar to the display name, but it is meant to be
170 * used when you want to rename the file in the UI. The display name
171 * might contain information you don't want in the new filename (such as
172 * "(invalid unicode)" if the filename was in an invalid encoding).
174 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
176 #define G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME "standard::edit-name" /* string */
179 * G_FILE_ATTRIBUTE_STANDARD_COPY_NAME:
181 * A key in the "standard" namespace for getting the copy name of the file.
182 * The copy name is an optional version of the name. If availible its always
183 * in UTF8, and corresponds directly to the original filename (only transcoded to
184 * UTF8). This is useful if you want to copy the file to another filesystem that
185 * might have a different encoding. If the filename is not a valid string in the
186 * encoding selected for the filesystem it is in then the copy name will not be set.
188 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
190 #define G_FILE_ATTRIBUTE_STANDARD_COPY_NAME "standard::copy-name" /* string */
193 * G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION:
195 * A key in the "standard" namespace for getting the description of the file.
196 * The description is a utf8 string that describes the file, generally containing
197 * the filename, but can also contain furter information. Example descriptions
198 * could be "filename (on hostname)" for a remote file or "filename (in trash)"
199 * for a file in the trash. This is useful for instance as the window title
200 * when displaying a directory or for a bookmarks menu.
202 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
204 #define G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION "standard::description" /* string */
207 * G_FILE_ATTRIBUTE_STANDARD_ICON:
209 * A key in the "standard" namespace for getting the icon for the file.
210 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
211 * The value for this key should contain a #GIcon.
213 #define G_FILE_ATTRIBUTE_STANDARD_ICON "standard::icon" /* object (GIcon) */
216 * G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE:
218 * A key in the "standard" namespace for getting the content type of the file.
219 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
220 * The value for this key should contain a valid content type.
222 #define G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE "standard::content-type" /* string */
225 * G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE:
227 * A key in the "standard" namespace for getting the fast content type.
228 * The fast content type isn't as reliable as the regular one, as it
229 * only uses the filename to guess it, but it is faster to calculate than the
230 * regular content type.
231 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
234 #define G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE "standard::fast-content-type" /* string */
237 * G_FILE_ATTRIBUTE_STANDARD_SIZE:
239 * A key in the "standard" namespace for getting the file's size (in bytes).
240 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
242 #define G_FILE_ATTRIBUTE_STANDARD_SIZE "standard::size" /* uint64 */
245 * G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET:
247 * A key in the "standard" namespace for getting the symlink target, if the file
248 * is a symlink. Corresponding #GFileAttributeType is
249 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
251 #define G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET "standard::symlink-target" /* byte string */
254 * G_FILE_ATTRIBUTE_STANDARD_TARGET_URI:
256 * A key in the "standard" namespace for getting the target URI for the file, in
257 * the case of %G_FILE_TYPE_SHORTCUT or %G_FILE_TYPE_MOUNTABLE files.
258 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
260 #define G_FILE_ATTRIBUTE_STANDARD_TARGET_URI "standard::target-uri" /* string */
263 * G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER:
265 * A key in the "standard" namespace for setting the sort order of a file.
266 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
267 * An example use would be in file managers, which would use this key
268 * to set the order files are displayed. Files with smaller sort order
269 * should be sorted first, and files without sort order as if sort order
272 #define G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER "standard::sort-order" /* int32 */
274 /* Entity tags, used to avoid missing updates on save */
277 * G_FILE_ATTRIBUTE_ETAG_VALUE:
279 * A key in the "etag" namespace for getting the value of the file's
280 * entity tag. Corresponding #GFileAttributeType is
281 * %G_FILE_ATTRIBUTE_TYPE_STRING.
283 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag::value" /* string */
285 /* File identifier, for e.g. avoiding loops when doing recursive
290 * G_FILE_ATTRIBUTE_ID_FILE:
292 * A key in the "id" namespace for getting a file identifier.
293 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
294 * An example use would be during listing files, to avoid recursive
295 * directory scanning.
297 #define G_FILE_ATTRIBUTE_ID_FILE "id::file" /* string */
300 * G_FILE_ATTRIBUTE_ID_FILESYSTEM:
302 * A key in the "id" namespace for getting the file system identifier.
303 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
304 * An example use would be during drag and drop to see if the source
305 * and target are on the same filesystem (default to move) or not (default
308 #define G_FILE_ATTRIBUTE_ID_FILESYSTEM "id::filesystem" /* string */
310 /* Calculated Access Rights for current user */
313 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
315 * A key in the "access" namespace for getting read privileges.
316 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
317 * This attribute will be %TRUE if the user is able to read the file.
319 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access::can-read" /* boolean */
322 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
324 * A key in the "access" namespace for getting write privileges.
325 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
326 * This attribute will be %TRUE if the user is able to write to the file.
328 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access::can-write" /* boolean */
331 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
333 * A key in the "access" namespace for getting execution privileges.
334 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
335 * This attribute will be %TRUE if the user is able to execute the file.
337 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access::can-execute" /* boolean */
340 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
342 * A key in the "access" namespace for checking deletion privileges.
343 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
344 * This attribute will be %TRUE if the user is able to delete the file.
346 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access::can-delete" /* boolean */
349 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
351 * A key in the "access" namespace for checking trashing privileges.
352 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
353 * This attribute will be %TRUE if the user is able to move the file to
356 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access::can-trash" /* boolean */
359 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
361 * A key in the "access" namespace for checking renaming privileges.
362 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
363 * This attribute will be %TRUE if the user is able to rename the file.
365 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access::can-rename" /* boolean */
367 /* TODO: Should we have special version for directories? can_enumerate, etc */
369 /* Mountable attributes */
372 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
374 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is mountable.
375 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
377 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable::can-mount" /* boolean */
380 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
382 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) is unmountable.
383 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
385 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable::can-unmount" /* boolean */
388 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
390 * A key in the "mountable" namespace for checking if a file (of type G_FILE_TYPE_MOUNTABLE) can be ejected.
391 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
393 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable::can-eject" /* boolean */
396 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
398 * A key in the "mountable" namespace for getting the unix device.
399 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
401 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable::unix-device" /* uint32 */
404 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
406 * A key in the "mountable" namespace for getting the HAL UDI for the mountable
407 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
409 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable::hal-udi" /* string */
411 /* Time attributes */
414 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
416 * A key in the "time" namespace for getting the time the file was last
417 * modified. Corresponding #GFileAttributeType is
418 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
421 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time::modified" /* uint64 */
424 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
426 * A key in the "time" namespace for getting the milliseconds of the time
427 * the file was last modified. This should be used in conjunction with
428 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
429 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
431 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time::modified-usec" /* uint32 */
434 * G_FILE_ATTRIBUTE_TIME_ACCESS:
436 * A key in the "time" namespace for getting the time the file was last
437 * accessed. Corresponding #GFileAttributeType is
438 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
439 * file was last accessed.
441 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time::access" /* uint64 */
444 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
446 * A key in the "time" namespace for getting the milliseconds of the time
447 * the file was last accessed. This should be used in conjunction with
448 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
449 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
451 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time::access-usec" /* uint32 */
454 * G_FILE_ATTRIBUTE_TIME_CHANGED:
456 * A key in the "time" namespace for getting the time the file was last
457 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
458 * and contains the UNIX time since the file was last changed.
460 * This corresponds to the traditional UNIX ctime.
462 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time::changed" /* uint64 */
465 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
467 * A key in the "time" namespace for getting the milliseconds of the time
468 * the file was last changed. This should be used in conjunction with
469 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
470 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
472 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time::changed-usec" /* uint32 */
475 * G_FILE_ATTRIBUTE_TIME_CREATED:
477 * A key in the "time" namespace for getting the time the file was created.
478 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
479 * and contains the UNIX time since the file was created.
481 * This corresponds to the NTFS ctime.
483 #define G_FILE_ATTRIBUTE_TIME_CREATED "time::created" /* uint64 */
486 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
488 * A key in the "time" namespace for getting the milliseconds of the time
489 * the file was created. This should be used in conjunction with
490 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
491 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
493 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time::created-usec" /* uint32 */
495 /* Unix specific attributes */
498 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
500 * A key in the "unix" namespace for getting the device id of the device the
501 * file is located on (see stat() documentation). This attribute is only
502 * available for UNIX file systems. Corresponding #GFileAttributeType is
503 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
505 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix::device" /* uint32 */
508 * G_FILE_ATTRIBUTE_UNIX_INODE:
510 * A key in the "unix" namespace for getting the inode of the file.
511 * This attribute is only available for UNIX file systems. Corresponding
512 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
514 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix::inode" /* uint64 */
517 * G_FILE_ATTRIBUTE_UNIX_MODE:
519 * A key in the "unix" namespace for getting the mode of the file
520 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
521 * documentation. This attribute is only available for UNIX file systems.
522 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
524 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix::mode" /* uint32 */
527 * G_FILE_ATTRIBUTE_UNIX_NLINK:
529 * A key in the "unix" namespace for getting the number of hard links
530 * for a file. See lstat() documentation. This attribute is only available
531 * for UNIX file systems. Corresponding #GFileAttributeType is
532 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
534 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix::nlink" /* uint32 */
537 * G_FILE_ATTRIBUTE_UNIX_UID:
539 * A key in the "unix" namespace for getting the user ID for the file.
540 * This attribute is only available for UNIX file systems.
541 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
543 #define G_FILE_ATTRIBUTE_UNIX_UID "unix::uid" /* uint32 */
546 * G_FILE_ATTRIBUTE_UNIX_GID:
548 * A key in the "unix" namespace for getting the group ID for the file.
549 * This attribute is only available for UNIX file systems.
550 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
552 #define G_FILE_ATTRIBUTE_UNIX_GID "unix::gid" /* uint32 */
555 * G_FILE_ATTRIBUTE_UNIX_RDEV:
557 * A key in the "unix" namespace for getting the device ID for the file
558 * (if it is a special file). See lstat() documentation. This attribute
559 * is only available for UNIX file systems. Corresponding #GFileAttributeType
560 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
562 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix::rdev" /* uint32 */
565 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
567 * A key in the "unix" namespace for getting the block size for the file
568 * system. This attribute is only available for UNIX file systems.
569 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
571 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix::block-size" /* uint32 */
574 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
576 * A key in the "unix" namespace for getting the number of blocks allocated
577 * for the file. This attribute is only available for UNIX file systems.
578 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
580 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix::blocks" /* uint64 */
583 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
585 * A key in the "unix" namespace for checking if the file represents a
586 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
587 * point. This attribute is only available for UNIX file systems.
588 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
590 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix::is-mountpoint" /* boolean */
592 /* DOS specific attributes */
595 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
597 * A key in the "dos" namespace for checking if the file's archive flag
598 * is set. This attribute is %TRUE if the archive flag is set. This attribute
599 * is only available for DOS file systems. Corresponding #GFileAttributeType
600 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
602 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos::is-archive" /* boolean */
605 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
607 * A key in the "dos" namespace for checking if the file's backup flag
608 * is set. This attribute is %TRUE if the backup flag is set. This attribute
609 * is only available for DOS file systems. Corresponding #GFileAttributeType
610 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
612 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos::is-system" /* boolean */
614 /* Owner attributes */
617 * G_FILE_ATTRIBUTE_OWNER_USER:
619 * A key in the "owner" namespace for getting the user name of the
620 * file's owner. Corresponding #GFileAttributeType is
621 * %G_FILE_ATTRIBUTE_TYPE_STRING.
623 #define G_FILE_ATTRIBUTE_OWNER_USER "owner::user" /* string */
626 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
628 * A key in the "owner" namespace for getting the real name of the
629 * user that owns the file. Corresponding #GFileAttributeType is
630 * %G_FILE_ATTRIBUTE_TYPE_STRING.
632 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner::user-real" /* string */
635 * G_FILE_ATTRIBUTE_OWNER_GROUP:
637 * A key in the "owner" namespace for getting the file owner's group.
638 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
640 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner::group" /* string */
645 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
647 * A key in the "thumbnail" namespace for getting the path to the thumbnail
648 * image. Corresponding #GFileAttributeType is
649 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
651 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail::path" /* bytestring */
653 * G_FILE_ATTRIBUTE_THUMBNAILING_FAILED:
655 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
656 * This attribute is %TRUE if thumbnailing failed. Corresponding
657 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
659 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
661 /* File system info (for g_file_get_filesystem_info) */
664 * G_FILE_ATTRIBUTE_FILESYSTEM_SIZE:
666 * A key in the "filesystem" namespace for getting the total size (in bytes) of the file system,
667 * used in g_file_query_filesystem_info(). Corresponding #GFileAttributeType
668 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
670 #define G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "filesystem::size" /* uint64 */
673 * G_FILE_ATTRIBUTE_FILESYSTEM_FREE:
675 * A key in the "filesystem" namespace for getting the number of bytes of free space left on the
676 * file system. Corresponding #GFileAttributeType is
677 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
679 #define G_FILE_ATTRIBUTE_FILESYSTEM_FREE "filesystem::free" /* uint64 */
682 * G_FILE_ATTRIBUTE_FILESYSTEM_TYPE:
684 * A key in the "filesystem" namespace for getting the file system's type.
685 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
687 #define G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "filesystem::type" /* string */
690 * G_FILE_ATTRIBUTE_FILESYSTEM_READONLY:
692 * A key in the "filesystem" namespace for checking if the file system
693 * is read only. Is set to %TRUE if the file system is read only.
694 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
696 #define G_FILE_ATTRIBUTE_FILESYSTEM_READONLY "filesystem::readonly" /* boolean */
699 * G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW:
701 * A key in the "filesystem" namespace for hinting a file manager
702 * application whether it should preview (e.g. thumbnail) files on the
703 * file system. The value for this key contain a
704 * #GFilesystemPreviewType.
706 #define G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW "filesystem::use-preview" /* uint32 (GFilesystemPreviewType) */
709 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
711 * A key in the "gvfs" namespace that gets the name of the current
712 * GVFS backend in use. Corresponding #GFileAttributeType is
713 * %G_FILE_ATTRIBUTE_TYPE_STRING.
715 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs::backend" /* string */
718 * G_FILE_ATTRIBUTE_SELINUX_CONTEXT:
720 * A key in the "selinux" namespace for getting the file's SELinux
721 * context. Corresponding #GFileAttributeType is
722 * %G_FILE_ATTRIBUTE_TYPE_STRING. Note that this attribute is only
723 * available if GLib has been built with SELinux support.
725 #define G_FILE_ATTRIBUTE_SELINUX_CONTEXT "selinux::context" /* string */
728 * G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT:
730 * A key in the "trash" namespace. When requested against 'trash:///'
731 * returns the number of (toplevel) items in the trash folder.
732 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
734 #define G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT "trash::item-count" /* uint32 */
736 GType g_file_info_get_type (void) G_GNUC_CONST;
738 GFileInfo * g_file_info_new (void);
739 GFileInfo * g_file_info_dup (GFileInfo *other);
740 void g_file_info_copy_into (GFileInfo *src_info,
741 GFileInfo *dest_info);
742 gboolean g_file_info_has_attribute (GFileInfo *info,
743 const char *attribute);
744 char ** g_file_info_list_attributes (GFileInfo *info,
745 const char *name_space);
746 gboolean g_file_info_get_attribute_data (GFileInfo *info,
747 const char *attribute,
748 GFileAttributeType *type,
750 GFileAttributeStatus *status);
751 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
752 const char *attribute);
753 void g_file_info_remove_attribute (GFileInfo *info,
754 const char *attribute);
755 GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info,
756 const char *attribute);
757 char * g_file_info_get_attribute_as_string (GFileInfo *info,
758 const char *attribute);
759 const char * g_file_info_get_attribute_string (GFileInfo *info,
760 const char *attribute);
761 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
762 const char *attribute);
763 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
764 const char *attribute);
765 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
766 const char *attribute);
767 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
768 const char *attribute);
769 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
770 const char *attribute);
771 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
772 const char *attribute);
773 GObject * g_file_info_get_attribute_object (GFileInfo *info,
774 const char *attribute);
776 void g_file_info_set_attribute (GFileInfo *info,
777 const char *attribute,
778 GFileAttributeType type,
780 void g_file_info_set_attribute_string (GFileInfo *info,
781 const char *attribute,
782 const char *attr_value);
783 void g_file_info_set_attribute_byte_string (GFileInfo *info,
784 const char *attribute,
785 const char *attr_value);
786 void g_file_info_set_attribute_boolean (GFileInfo *info,
787 const char *attribute,
788 gboolean attr_value);
789 void g_file_info_set_attribute_uint32 (GFileInfo *info,
790 const char *attribute,
792 void g_file_info_set_attribute_int32 (GFileInfo *info,
793 const char *attribute,
795 void g_file_info_set_attribute_uint64 (GFileInfo *info,
796 const char *attribute,
798 void g_file_info_set_attribute_int64 (GFileInfo *info,
799 const char *attribute,
801 void g_file_info_set_attribute_object (GFileInfo *info,
802 const char *attribute,
803 GObject *attr_value);
805 void g_file_info_clear_status (GFileInfo *info);
807 /* Helper getters: */
808 GFileType g_file_info_get_file_type (GFileInfo *info);
809 gboolean g_file_info_get_is_hidden (GFileInfo *info);
810 gboolean g_file_info_get_is_backup (GFileInfo *info);
811 gboolean g_file_info_get_is_symlink (GFileInfo *info);
812 const char * g_file_info_get_name (GFileInfo *info);
813 const char * g_file_info_get_display_name (GFileInfo *info);
814 const char * g_file_info_get_edit_name (GFileInfo *info);
815 GIcon * g_file_info_get_icon (GFileInfo *info);
816 const char * g_file_info_get_content_type (GFileInfo *info);
817 goffset g_file_info_get_size (GFileInfo *info);
818 void g_file_info_get_modification_time (GFileInfo *info,
820 const char * g_file_info_get_symlink_target (GFileInfo *info);
821 const char * g_file_info_get_etag (GFileInfo *info);
822 gint32 g_file_info_get_sort_order (GFileInfo *info);
824 void g_file_info_set_attribute_mask (GFileInfo *info,
825 GFileAttributeMatcher *mask);
826 void g_file_info_unset_attribute_mask (GFileInfo *info);
828 /* Helper setters: */
829 void g_file_info_set_file_type (GFileInfo *info,
831 void g_file_info_set_is_hidden (GFileInfo *info,
833 void g_file_info_set_is_symlink (GFileInfo *info,
834 gboolean is_symlink);
835 void g_file_info_set_name (GFileInfo *info,
837 void g_file_info_set_display_name (GFileInfo *info,
838 const char *display_name);
839 void g_file_info_set_edit_name (GFileInfo *info,
840 const char *edit_name);
841 void g_file_info_set_icon (GFileInfo *info,
843 void g_file_info_set_content_type (GFileInfo *info,
844 const char *content_type);
845 void g_file_info_set_size (GFileInfo *info,
847 void g_file_info_set_modification_time (GFileInfo *info,
849 void g_file_info_set_symlink_target (GFileInfo *info,
850 const char *symlink_target);
851 void g_file_info_set_sort_order (GFileInfo *info,
854 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
855 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
856 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
857 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
858 const char *attribute);
859 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
860 const char *attribute);
861 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
863 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
868 #endif /* __G_FILE_INFO_H__ */