### Method

# FwupdPlugin Device get_contents

#### Declaration [src]

    gchar*
    fu_device_get_contents (
      FuDevice* self,
      const gchar* filename,
      gsize count,
      FuProgress* progress,
      GError** error
    )

#### Description [src]

Reads a blob of ASCII text from the file, emulating if required.

Available since: | 2.0.12

#### Parameters

`filename` | `const gchar*`
| Full path to a file.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`count` | `gsize`
| Maximum number of bytes to read.
`progress` | `FuProgress`
| Optional `FuProgress`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `gchar*`
| A `GBytes`, or `NULL` on error.
| 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.