### Method

# Gio File load_contents_async

#### Declaration

    void
    g_file_load_contents_async (
      GFile* file,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description

Starts an asynchronous load of the `file`‘s contents.

For more details, see `g_file_load_contents()` which is the synchronous version of this call.

When the load operation has completed, `callback` will be called with `user` data. To finish the operation, call `g_file_load_contents_finish()` with the `GAsyncResult` returned by the `callback`.

If `cancellable` is not `NULL`, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error `G_IO_ERROR_CANCELLED` will be returned.

#### Parameters

`cancellable`

  Type: `GCancellable`

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

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

`callback`

  Type: `GAsyncReadyCallback`

  A `GAsyncReadyCallback` to call when the request is satisfied.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  The data to pass to callback function.

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