### Method

# Gio FileInfo get_attribute_as_string

#### Declaration

    char*
    g_file_info_get_attribute_as_string (
      GFileInfo* info,
      const char* attribute
    )

#### Description

Gets the value of an attribute, formatted as a string. This escapes things as needed to make the string valid UTF-8.

#### Parameters

`attribute`

  Type: `const char*`

  A file attribute key.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `char*`

A UTF-8 string associated with the given `attribute`, or `NULL` if the attribute wasn’t set. When you’re done with the string it must be freed with g_free().

The caller of the method takes ownership of the data, and is responsible for freeing it.
The return value can be `NULL`.
The value is a NUL terminated UTF-8 string.