Gio.FileAttributeMatcher.new
Description: Reference for Gio.FileAttributeMatcher.new

### Function

# Gio FileAttributeMatchernew

#### Declaration [src]

    GFileAttributeMatcher*
    g_file_attribute_matcher_new (
      const char* attributes
    )

#### Description [src]

Creates a new file attribute matcher, which matches attributes against a given string. `GFileAttributeMatchers` are reference counted structures, and are created with a reference count of 1. If the number of references falls to 0, the `GFileAttributeMatcher` is automatically destroyed.

The `attributes` string should be formatted with specific keys separated from namespaces with a double colon. Several “namespace::key” strings may be concatenated with a single comma (e.g. “standard::type,standard::is-hidden”). The wildcard “” may be used to match all keys and namespaces, or “namespace::” will match all keys in a given namespace.

## Examples of file attribute matcher strings and results

- `"*"`: matches all attributes.
- `"standard::is-hidden"`: matches only the key is-hidden in the standard namespace.
- `"standard::type,unix::*"`: matches the type key in the standard namespace and all keys in the unix namespace.

#### Parameters

`attributes`

  Type: `const char*`

  An attribute string to match.

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

#### Return value

Type: `GFileAttributeMatcher`

A `GFileAttributeMatcher`.

The caller of the function takes ownership of the data, and is responsible for freeing it.