Ide.BufferManager.load_file_async

### Method

# Ide BufferManagerload_file_async

#### Declaration

    void
    ide_buffer_manager_load_file_async (
      IdeBufferManager* self,
      GFile* file,
      IdeBufferOpenFlags flags,
      IdeNotification* notif,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description

Requests that `file` be loaded by the buffer manager. Depending on `flags`, this may result in a new view being displayed in a Builder workspace.

If `file` is `NULL`, then a new temporary file is created with an incrementing number to denote the document, such as “unsaved file 1”.

After completion, `callback` will be executed and you can receive the buffer that was loaded with ide_buffer_manager_load_file_finish().

If a buffer has already been loaded from `file`, the operation will complete using that existing buffer.

If a buffer is currently loading for `file`, the operation will complete using that existing buffer after it has completed loading.

If `notif` is non-NULL, it will be updated with status information while loading the document.

Available since: | 3.32

#### Parameters

`file` | `GFile`
| A `GFile`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`flags` | `IdeBufferOpenFlags`
| Optional flags for loading the buffer.
`notif` | `IdeNotification`
| A location for an `IdeNotification`, or `NULL`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`cancellable` | `GCancellable`
| A `GCancellable` or `NULL`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`callback` | `GAsyncReadyCallback`
| A callback to execute upon completion of the operation.
| The argument can be `NULL`.
`user_data` | `gpointer`
| Closure data for `callback`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.