---
name: "bson_reader_new_from_file"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_reader_new_from_file"
---

# bson\_reader\_new\_from\_file(3)

## SYNOPSIS

```
bson_reader_t *
bson_reader_new_from_file (const char *path, bson_error_t *error);
```

## PARAMETERS

- •

  **path**: A filename in the host filename encoding.

- •

  **error**: A *bson\_error\_t*.

## DESCRIPTION

Creates a new *bson\_reader\_t* using the file denoted by **filename**.

## ERRORS

Errors are propagated via the **error** parameter.

## RETURNS

A newly allocated *bson\_reader\_t* on success, otherwise NULL and error is set.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
