# file_contents

> Documentation index: http://docs.tenzir.com/llms.txt

Reads a file’s contents.

```tql
file_contents(path:string, [binary=bool]) -> blob|string
```

## Description

The `file_contents` function reads a file’s contents.

### `path: string`

Absolute path of file to read.

### `binary = bool (optional)`

Whether to read the file contents as a `blob`, instead of a `string`.

Defaults to `false`.

## Examples

### Read a text file

```tql
from {hostname: file_contents("/etc/hostname")}
```

## See Also

* [`file_name`](http://docs.tenzir.com/reference/functions/file_name.md)
* [`parent_dir`](http://docs.tenzir.com/reference/functions/parent_dir.md)
* [Manipulate strings](http://docs.tenzir.com/guides/transformation/manipulate-strings.md)