Gio.File.build_attribute_list_for_copy

### Method

# Gio Filebuild_attribute_list_for_copy

since: 2.68

#### Declaration

    char*
    g_file_build_attribute_list_for_copy (
      GFile* file,
      GFileCopyFlags flags,
      GCancellable* cancellable,
      GError** error
    )

#### Description

Prepares the file attribute query string for copying to `file`.

This function prepares an attribute query string to be passed to `g_file_query_info()` to get a list of attributes normally copied with the file (see `g_file_copy_attributes()` for the detailed description). This function is used by the implementation of `g_file_copy_attributes()` and is useful when one needs to query and set the attributes in two stages (e.g., for recursive move of a directory).

Available since: 2.68

#### Parameters

`flags`

  Type: `GFileCopyFlags`

  A set of `GFileCopyFlags`.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, `NULL` to ignore.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `char*`

An attribute query string for g_file_query_info(), or `NULL` if an error occurs.

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