<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gio-GFileAttribute">
<refmeta>
<refentrytitle role="top_of_page" id="gio-GFileAttribute.top_of_page">GFileAttribute</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GFileAttribute</refname>
<refpurpose>Key-Value Paired File Attributes</refpurpose>
</refnamediv>

<refsynopsisdiv id="gio-GFileAttribute.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;gio/gio.h&gt;

enum                <link linkend="GFileAttributeType">GFileAttributeType</link>;
enum                <link linkend="GFileAttributeInfoFlags">GFileAttributeInfoFlags</link>;
enum                <link linkend="GFileAttributeStatus">GFileAttributeStatus</link>;
                    <link linkend="GFileAttributeInfo">GFileAttributeInfo</link>;
                    <link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link>;
<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> * <link linkend="g-file-attribute-info-list-new">g_file_attribute_info_list_new</link> (void);
<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> * <link linkend="g-file-attribute-info-list-ref">g_file_attribute_info_list_ref</link> (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list);
<link linkend="void">void</link>                <link linkend="g-file-attribute-info-list-unref">g_file_attribute_info_list_unref</link>    (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list);
<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> * <link linkend="g-file-attribute-info-list-dup">g_file_attribute_info_list_dup</link> (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list);
const <link linkend="GFileAttributeInfo">GFileAttributeInfo</link> * <link linkend="g-file-attribute-info-list-lookup">g_file_attribute_info_list_lookup</link>
                                                        (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list,
                                                         const <link linkend="char">char</link> *name);
<link linkend="void">void</link>                <link linkend="g-file-attribute-info-list-add">g_file_attribute_info_list_add</link>      (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list,
                                                         const <link linkend="char">char</link> *name,
                                                         <link linkend="GFileAttributeType">GFileAttributeType</link> type,
                                                         <link linkend="GFileAttributeInfoFlags">GFileAttributeInfoFlags</link> flags);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gio-GFileAttribute.description" role="desc">
<title role="desc.title">Description</title>
<para>
File attributes in GIO consist of a list of key-value pairs. 
</para>
<para>
Keys are strings that contain a key namespace and a key name, separated
by a colon, e.g. "namespace:keyname". Namespaces are included to sort
key-value pairs by namespaces for relevance. Keys can be retrived 
using wildcards, e.g. "standard::*" will return all of the keys in the 
"standard" namespace.
</para>
<para>
Values are stored within the list in <link linkend="GFileAttributeValue"><type>GFileAttributeValue</type></link> structures.
Values can store different types, listed in the enum <link linkend="GFileAttributeType"><type>GFileAttributeType</type></link>.
Upon creation of a <link linkend="GFileAttributeValue"><type>GFileAttributeValue</type></link>, the type will be set to 
<link linkend="G-FILE-ATTRIBUTE-TYPE-INVALID--CAPS"><literal>G_FILE_ATTRIBUTE_TYPE_INVALID</literal></link>. 
</para>
<para>
The list of possible attributes for a filesystem (pointed to by a <link linkend="GFile"><type>GFile</type></link>) is
availible as a <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link>. This list is queryable by key names 
as indicated earlier.
</para>
<para>
Classes that implement <link linkend="GFileIface"><type>GFileIface</type></link> will create a <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link> and 
install default keys and values for their given file system, architecture, 
and other possible implementation details (e.g., on a UNIX system, a file 
attribute key will be registered for the user id for a given file).
</para>
<para>
<para>
<table>
<title>GFileAttributes Default Namespaces</title>
<tgroup cols='2' align='left'><thead>
<row><entry>Namspace</entry><entry>Description</entry></row>
</thead>
<tbody>
<row><entry>"standard"</entry><entry>The "Standard" namespace. General file
information that any application may need should be put in this namespace. 
Examples include the file's name, type, and size.</entry></row> 
<row><entry>"etag"</entry><entry>The <link linkend="gfile-etag">"Entity Tag"</link> 
namespace. Currently, the only key in this namespace is "value", which contains 
the value of the current entity tag.</entry></row>
<row><entry>"id"</entry><entry>The "Identification" namespace. This 
namespace is used by file managers and applications that list directories
to check for loops and to uniquely identify files.</entry></row>
<row><entry>"access"</entry><entry>The "Access" namespace. Used to check
if a user has the proper privilidges to access files and perform
file operations. Keys in this namespace are made to be generic 
and easily understood, e.g. the "can_read" key is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if 
the current user has permission to read the file. UNIX permissions and
NTFS ACLs in Windows should be mapped to these values.</entry></row>
<row><entry>"mountable"</entry><entry>The "Mountable" namespace. Includes 
simple boolean keys for checking if a file or path supports mount operations, e.g.
mount, unmount, eject. These are used for files of type <link linkend="G-FILE-TYPE-MOUNTABLE--CAPS"><literal>G_FILE_TYPE_MOUNTABLE</literal></link>.</entry></row>
<row><entry>"time"</entry><entry>The "Time" namespace. Includes file 
access, changed, created times. </entry></row>
<row><entry>"unix"</entry><entry>The "Unix" namespace. Includes UNIX-specific
information and may not be available for all files. Examples include 
the UNIX "UID", "GID", etc.</entry></row>
<row><entry>"dos"</entry><entry>The "DOS" namespace. Includes DOS-specific 
information and may not be available for all files. Examples include
"is_system" for checking if a file is marked as a system file, and "is_archive"
for checking if a file is marked as an archive file.</entry></row>
<row><entry>"owner"</entry><entry>The "Owner" namespace. Includes information
about who owns a file. May not be available for all file systems. Examples include
"user" for getting the user name of the file owner. This information is often mapped from
some backend specific data such as a unix UID.</entry></row>
<row><entry>"thumbnail"</entry><entry>The "Thumbnail" namespace. Includes 
information about file thumbnails and their location within the file system. Exaples of 
keys in this namespace include "path" to get the location of a thumbnail, and "failed"
to check if thumbnailing of the file failed.</entry></row>
<row><entry>"filesystem"</entry><entry>The "Filesystem" namespace. Gets information
about the file system where a file is located, such as its type, how much
space is left available, and the overall size of the file system.</entry></row>
<row><entry>"gvfs"</entry><entry>The "GVFS" namespace. Keys in this namespace
contain information about the current GVFS backend in use. </entry></row>
<row><entry>"xattr"</entry><entry>The "xattr" namespace. Gets information 
about extended user attributes. See attr(5). The "user." prefix of the
extended user attribute name is stripped away when constructing keys in
this namespace, e.g. "xattr::mime_type" for the extended attribute with 
the name "user.mime_type". Note that this information is only available
if GLib has been built with extended attribute support.</entry></row>
<row><entry>"xattr-sys"</entry><entry>The "xattr-sys" namespace. 
Gets information about extended attributes which are not user-specific. 
See attr(5). Note that this information is only available if GLib
has been built with extended attribute support.</entry></row>
<row><entry>"selinux"</entry><entry>The "SELinux" namespace. Includes
information about the SELinux context of files. Note that this information
is only available if GLib has been built with SELinux support.</entry></row>
</tbody>
</tgroup>
</table>
</para>
</para>
<para>
Please note that these are not all of the possible namespaces.
More namespaces can be added from GIO modules or by individual applications. 
For more information about writing GIO modules, see <link linkend="GIOModule"><type>GIOModule</type></link>.
</para>
<para>
<!-- TODO: Implementation note about using extended attributes on supported 
file systems -->
</para>
<para>
<para><table>
<title>GFileAttributes Built-in Keys and Value Types</title>
<tgroup cols='3' align='left'><thead>
<row><entry>Enum Value</entry><entry>Namespace:Key</entry><entry>Value Type</entry></row>
</thead><tbody>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-TYPE--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_TYPE</literal></link></entry><entry>standard::type</entry><entry>uint32 (<link linkend="GFileType"><type>GFileType</type></link>)</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-IS-HIDDEN--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN</literal></link></entry><entry>standard::is-hidden</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-IS-BACKUP--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP</literal></link></entry><entry>standard::is-backup</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-IS-SYMLINK--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK</literal></link></entry><entry>standard::is-symlink</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-IS-VIRTUAL--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL</literal></link></entry><entry>standard::is-virtual</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-NAME--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_NAME</literal></link></entry><entry>standard::name</entry><entry>byte string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-DISPLAY-NAME--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME</literal></link></entry><entry>standard::display-name</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-EDIT-NAME--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME</literal></link></entry><entry>standard::edit-name</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-ICON--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_ICON</literal></link></entry><entry>standard::icon</entry><entry>object (<link linkend="GIcon"><type>GIcon</type></link>)</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-CONTENT-TYPE--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE</literal></link></entry><entry>standard::content-type</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-FAST-CONTENT-TYPE--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE</literal></link></entry><entry>standard::fast-content-type</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-SIZE--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_SIZE</literal></link></entry><entry>standard::size</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-ALLOCATED-SIZE--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE</literal></link></entry><entry>standard::allocated-size</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-SYMLINK-TARGET--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET</literal></link></entry><entry>standard::symlink-target</entry><entry>byte string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-TARGET-URI--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_TARGET_URI</literal></link></entry><entry>standard::target-uri</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-STANDARD-SORT-ORDER--CAPS"><literal>G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER</literal></link></entry><entry>standard::sort-order</entry><entry>int32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ETAG-VALUE--CAPS"><literal>G_FILE_ATTRIBUTE_ETAG_VALUE</literal></link></entry><entry>etag::value</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ID-FILE--CAPS"><literal>G_FILE_ATTRIBUTE_ID_FILE</literal></link></entry><entry>id::file</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ID-FILESYSTEM--CAPS"><literal>G_FILE_ATTRIBUTE_ID_FILESYSTEM</literal></link></entry><entry>id::filesystem</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ACCESS-CAN-READ--CAPS"><literal>G_FILE_ATTRIBUTE_ACCESS_CAN_READ</literal></link></entry><entry>access::can-read</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ACCESS-CAN-WRITE--CAPS"><literal>G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE</literal></link></entry><entry>access::can-write</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ACCESS-CAN-EXECUTE--CAPS"><literal>G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE</literal></link></entry><entry>access::can-execute</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ACCESS-CAN-DELETE--CAPS"><literal>G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE</literal></link></entry><entry>access::can-delete</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ACCESS-CAN-TRASH--CAPS"><literal>G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH</literal></link></entry><entry>access::can-trash</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-ACCESS-CAN-RENAME--CAPS"><literal>G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME</literal></link></entry><entry>access::can-rename</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-MOUNTABLE-CAN-MOUNT--CAPS"><literal>G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT</literal></link></entry><entry>mountable::can-mount</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-MOUNTABLE-CAN-UNMOUNT--CAPS"><literal>G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT</literal></link></entry><entry>mountable::can-unmount</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-MOUNTABLE-CAN-EJECT--CAPS"><literal>G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT</literal></link></entry><entry>mountable::can-eject</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-MOUNTABLE-UNIX-DEVICE--CAPS"><literal>G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE</literal></link></entry><entry>mountable::unix-device</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-MOUNTABLE-HAL-UDI--CAPS"><literal>G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI</literal></link></entry><entry>mountable::hal-udi</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-MODIFIED--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_MODIFIED</literal></link></entry><entry>time::modified</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-MODIFIED-USEC--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC</literal></link></entry><entry>time::modified-usec</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-ACCESS--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_ACCESS</literal></link></entry><entry>time::access</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-ACCESS-USEC--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_ACCESS_USEC</literal></link></entry><entry>time::access-usec</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-CHANGED--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_CHANGED</literal></link></entry><entry>time::changed</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-CHANGED-USEC--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_CHANGED_USEC</literal></link></entry><entry>time::changed-usec</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-CREATED--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_CREATED</literal></link></entry><entry>time::created</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-TIME-CREATED-USEC--CAPS"><literal>G_FILE_ATTRIBUTE_TIME_CREATED_USEC</literal></link></entry><entry>time::created-usec</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-DEVICE--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_DEVICE</literal></link></entry><entry>unix::device</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-INODE--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_INODE</literal></link></entry><entry>unix::inode</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-MODE--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_MODE</literal></link></entry><entry>unix::mode</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-NLINK--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_NLINK</literal></link></entry><entry>unix::nlink</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-UID--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_UID</literal></link></entry><entry>unix::uid</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-GID--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_GID</literal></link></entry><entry>unix::gid</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-RDEV--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_RDEV</literal></link></entry><entry>unix::rdev</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-BLOCK-SIZE--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE</literal></link></entry><entry>unix::block-size</entry><entry>uint32</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-BLOCKS--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_BLOCKS</literal></link></entry><entry>unix::blocks</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-UNIX-IS-MOUNTPOINT--CAPS"><literal>G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT</literal></link></entry><entry>unix::is-mountpoint</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-DOS-IS-ARCHIVE--CAPS"><literal>G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE</literal></link></entry><entry>dos::is-archive</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-DOS-IS-SYSTEM--CAPS"><literal>G_FILE_ATTRIBUTE_DOS_IS_SYSTEM</literal></link></entry><entry>dos::is-system</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-OWNER-USER--CAPS"><literal>G_FILE_ATTRIBUTE_OWNER_USER</literal></link></entry><entry>owner::user</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-OWNER-USER-REAL--CAPS"><literal>G_FILE_ATTRIBUTE_OWNER_USER_REAL</literal></link></entry><entry>owner::user-real</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-OWNER-GROUP--CAPS"><literal>G_FILE_ATTRIBUTE_OWNER_GROUP</literal></link></entry><entry>owner::group</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-THUMBNAIL-PATH--CAPS"><literal>G_FILE_ATTRIBUTE_THUMBNAIL_PATH</literal></link></entry><entry>thumbnail::path</entry><entry>bytestring</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-THUMBNAILING-FAILED--CAPS"><literal>G_FILE_ATTRIBUTE_THUMBNAILING_FAILED</literal></link></entry><entry>thumbnail::failed</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-PREVIEW-ICON--CAPS"><literal>G_FILE_ATTRIBUTE_PREVIEW_ICON</literal></link></entry><entry>preview::icon</entry><entry>object (<link linkend="GIcon"><type>GIcon</type></link>)</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-FILESYSTEM-SIZE--CAPS"><literal>G_FILE_ATTRIBUTE_FILESYSTEM_SIZE</literal></link></entry><entry>filesystem::size</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-FILESYSTEM-FREE--CAPS"><literal>G_FILE_ATTRIBUTE_FILESYSTEM_FREE</literal></link></entry><entry>filesystem::free</entry><entry>uint64</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-FILESYSTEM-TYPE--CAPS"><literal>G_FILE_ATTRIBUTE_FILESYSTEM_TYPE</literal></link></entry><entry>filesystem::type</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-FILESYSTEM-READONLY--CAPS"><literal>G_FILE_ATTRIBUTE_FILESYSTEM_READONLY</literal></link></entry><entry>filesystem::readonly</entry><entry>boolean</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-GVFS-BACKEND--CAPS"><literal>G_FILE_ATTRIBUTE_GVFS_BACKEND</literal></link></entry><entry>gvfs::backend</entry><entry>string</entry></row>
<row><entry><link linkend="G-FILE-ATTRIBUTE-SELINUX-CONTEXT--CAPS"><literal>G_FILE_ATTRIBUTE_SELINUX_CONTEXT</literal></link></entry><entry>selinux::context</entry><entry>string</entry></row>
</tbody></tgroup></table></para>
 
Note that there are no predefined keys in the "xattr" and "xattr-sys" 
namespaces. Keys for the "xattr" namespace are constructed by stripping
away the "user." prefix from the extended user attribute, and prepending
"xattr::". Keys for the "xattr-sys" namespace are constructed by 
concatenating "xattr-sys::" with the extended attribute name. All extended
attribute values are returned as hex-encoded strings in which bytes outside
the ASCII range are encoded as hexadecimal escape sequences of the form
\x<replaceable>nn</replaceable>.</para>
<para>
</para>
</refsect1>

<refsect1 id="gio-GFileAttribute.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GFileAttributeType" role="enum">
<title>enum GFileAttributeType</title>
<indexterm zone="GFileAttributeType"><primary sortas="FileAttributeType">GFileAttributeType</primary></indexterm><programlisting>typedef enum {
  G_FILE_ATTRIBUTE_TYPE_INVALID = 0,
  G_FILE_ATTRIBUTE_TYPE_STRING,
  G_FILE_ATTRIBUTE_TYPE_BYTE_STRING, /* zero terminated string of non-zero bytes */
  G_FILE_ATTRIBUTE_TYPE_BOOLEAN,
  G_FILE_ATTRIBUTE_TYPE_UINT32,
  G_FILE_ATTRIBUTE_TYPE_INT32,
  G_FILE_ATTRIBUTE_TYPE_UINT64,
  G_FILE_ATTRIBUTE_TYPE_INT64,
  G_FILE_ATTRIBUTE_TYPE_OBJECT,
  G_FILE_ATTRIBUTE_TYPE_STRINGV
} GFileAttributeType;
</programlisting>
<para>
The data types for file attributes.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-INVALID--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_INVALID</literal></term>
<listitem><simpara> indicates an invalid or uninitalized type.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-STRING--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_STRING</literal></term>
<listitem><simpara> a null terminated UTF8 string.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-BYTE-STRING--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_BYTE_STRING</literal></term>
<listitem><simpara> a zero terminated string of non-zero bytes.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-BOOLEAN--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_BOOLEAN</literal></term>
<listitem><simpara> a boolean value.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-UINT32--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_UINT32</literal></term>
<listitem><simpara> an unsigned 4-byte/32-bit integer.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-INT32--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_INT32</literal></term>
<listitem><simpara> a signed 4-byte/32-bit integer.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-UINT64--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_UINT64</literal></term>
<listitem><simpara> an unsigned 8-byte/64-bit integer.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-INT64--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_INT64</literal></term>
<listitem><simpara> a signed 8-byte/64-bit integer.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-OBJECT--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_OBJECT</literal></term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-TYPE-STRINGV--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_TYPE_STRINGV</literal></term>
<listitem><simpara> a <link linkend="NULL--CAPS"><literal>NULL</literal></link> terminated char **. Since 2.22
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GFileAttributeInfoFlags" role="enum">
<title>enum GFileAttributeInfoFlags</title>
<indexterm zone="GFileAttributeInfoFlags"><primary sortas="FileAttributeInfoFlags">GFileAttributeInfoFlags</primary></indexterm><programlisting>typedef enum {
  G_FILE_ATTRIBUTE_INFO_NONE            = 0,
  G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE  = (1 &lt;&lt; 0),
  G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED = (1 &lt;&lt; 1)
} GFileAttributeInfoFlags;
</programlisting>
<para>
Flags specifying the behaviour of an attribute.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-FILE-ATTRIBUTE-INFO-NONE--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_INFO_NONE</literal></term>
<listitem><simpara> no flags set.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-INFO-COPY-WITH-FILE--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_INFO_COPY_WITH_FILE</literal></term>
<listitem><simpara> copy the attribute values when the file is copied.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-INFO-COPY-WHEN-MOVED--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_INFO_COPY_WHEN_MOVED</literal></term>
<listitem><simpara> copy the attribute values when the file is moved.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GFileAttributeStatus" role="enum">
<title>enum GFileAttributeStatus</title>
<indexterm zone="GFileAttributeStatus"><primary sortas="FileAttributeStatus">GFileAttributeStatus</primary></indexterm><programlisting>typedef enum {
  G_FILE_ATTRIBUTE_STATUS_UNSET = 0,
  G_FILE_ATTRIBUTE_STATUS_SET,
  G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING
} GFileAttributeStatus;
</programlisting>
<para>
Used by <link linkend="g-file-set-attributes-from-info"><function>g_file_set_attributes_from_info()</function></link> when setting file attributes.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-FILE-ATTRIBUTE-STATUS-UNSET--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_STATUS_UNSET</literal></term>
<listitem><simpara> Attribute value is unset (empty).
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-STATUS-SET--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_STATUS_SET</literal></term>
<listitem><simpara> Attribute value is set.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-FILE-ATTRIBUTE-STATUS-ERROR-SETTING--CAPS" role="constant">
<term><literal>G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING</literal></term>
<listitem><simpara> Indicates an error in setting the value.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GFileAttributeInfo" role="struct">
<title>GFileAttributeInfo</title>
<indexterm zone="GFileAttributeInfo"><primary sortas="FileAttributeInfo">GFileAttributeInfo</primary></indexterm><programlisting>typedef struct {
  char                    *name;
  GFileAttributeType       type;
  GFileAttributeInfoFlags  flags;
} GFileAttributeInfo;
</programlisting>
<para>
Information about a specific attribute.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="char">char</link>&#160;*<structfield>name</structfield>;</term>
<listitem><simpara> the name of the attribute.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GFileAttributeType">GFileAttributeType</link>&#160;<structfield>type</structfield>;</term>
<listitem><simpara> the <link linkend="GFileAttributeType"><type>GFileAttributeType</type></link> type of the attribute.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GFileAttributeInfoFlags">GFileAttributeInfoFlags</link>&#160;<structfield>flags</structfield>;</term>
<listitem><simpara> a set of <link linkend="GFileAttributeInfoFlags"><type>GFileAttributeInfoFlags</type></link>.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GFileAttributeInfoList" role="struct">
<title>GFileAttributeInfoList</title>
<indexterm zone="GFileAttributeInfoList"><primary sortas="FileAttributeInfoList">GFileAttributeInfoList</primary></indexterm><programlisting>typedef struct {
  GFileAttributeInfo *infos;
  int                 n_infos;
} GFileAttributeInfoList;
</programlisting>
<para>
Acts as a lightweight registry for possible valid file attributes.
The registry stores Key-Value pair formats as <link linkend="GFileAttributeInfo"><type>GFileAttributeInfo</type></link><!-- -->s.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GFileAttributeInfo">GFileAttributeInfo</link>&#160;*<structfield>infos</structfield>;</term>
<listitem><simpara> an array of <link linkend="GFileAttributeInfo"><type>GFileAttributeInfo</type></link><!-- -->s.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="int">int</link>&#160;<structfield>n_infos</structfield>;</term>
<listitem><simpara> the number of values in the array.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-attribute-info-list-new" role="function">
<title>g_file_attribute_info_list_new ()</title>
<indexterm zone="g-file-attribute-info-list-new"><primary sortas="file_attribute_info_list_new">g_file_attribute_info_list_new</primary></indexterm><programlisting><link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> * g_file_attribute_info_list_new (void);</programlisting>
<para>
Creates a new file attribute info list.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-attribute-info-list-ref" role="function">
<title>g_file_attribute_info_list_ref ()</title>
<indexterm zone="g-file-attribute-info-list-ref"><primary sortas="file_attribute_info_list_ref">g_file_attribute_info_list_ref</primary></indexterm><programlisting><link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> * g_file_attribute_info_list_ref (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list);</programlisting>
<para>
References a file attribute info list.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>list</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link> to reference.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-attribute-info-list-unref" role="function">
<title>g_file_attribute_info_list_unref ()</title>
<indexterm zone="g-file-attribute-info-list-unref"><primary sortas="file_attribute_info_list_unref">g_file_attribute_info_list_unref</primary></indexterm><programlisting><link linkend="void">void</link>                g_file_attribute_info_list_unref    (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list);</programlisting>
<para>
Removes a reference from the given <parameter>list</parameter>. If the reference count
falls to zero, the <parameter>list</parameter> is deleted.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>list</parameter>&#160;:</term>
<listitem><simpara> The <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link> to unreference.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-attribute-info-list-dup" role="function">
<title>g_file_attribute_info_list_dup ()</title>
<indexterm zone="g-file-attribute-info-list-dup"><primary sortas="file_attribute_info_list_dup">g_file_attribute_info_list_dup</primary></indexterm><programlisting><link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> * g_file_attribute_info_list_dup (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list);</programlisting>
<para>
Makes a duplicate of a file attribute info list.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>list</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link> to duplicate.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a copy of the given <parameter>list</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-attribute-info-list-lookup" role="function">
<title>g_file_attribute_info_list_lookup ()</title>
<indexterm zone="g-file-attribute-info-list-lookup"><primary sortas="file_attribute_info_list_lookup">g_file_attribute_info_list_lookup</primary></indexterm><programlisting>const <link linkend="GFileAttributeInfo">GFileAttributeInfo</link> * g_file_attribute_info_list_lookup
                                                        (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list,
                                                         const <link linkend="char">char</link> *name);</programlisting>
<para>
Gets the file attribute with the name <parameter>name</parameter> from <parameter>list</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>list</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the name of the attribute to lookup.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GFileAttributeInfo"><type>GFileAttributeInfo</type></link> for the <parameter>name</parameter>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if an
attribute isn't found.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-file-attribute-info-list-add" role="function">
<title>g_file_attribute_info_list_add ()</title>
<indexterm zone="g-file-attribute-info-list-add"><primary sortas="file_attribute_info_list_add">g_file_attribute_info_list_add</primary></indexterm><programlisting><link linkend="void">void</link>                g_file_attribute_info_list_add      (<link linkend="GFileAttributeInfoList">GFileAttributeInfoList</link> *list,
                                                         const <link linkend="char">char</link> *name,
                                                         <link linkend="GFileAttributeType">GFileAttributeType</link> type,
                                                         <link linkend="GFileAttributeInfoFlags">GFileAttributeInfoFlags</link> flags);</programlisting>
<para>
Adds a new attribute with <parameter>name</parameter> to the <parameter>list</parameter>, setting
its <parameter>type</parameter> and <parameter>flags</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>list</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GFileAttributeInfoList"><type>GFileAttributeInfoList</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the name of the attribute to add.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GFileAttributeType"><type>GFileAttributeType</type></link> for the attribute.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GFileAttributeInfoFlags"><type>GFileAttributeInfoFlags</type></link> for the attribute.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1 id="gio-GFileAttribute.see-also">
<title>See Also</title>
#GFile, <link linkend="GFileInfo"><type>GFileInfo</type></link>
</refsect1>

</refentry>
