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

# mongoc\_stream\_gridfs\_new(3)

## SYNOPSIS

```
mongoc_stream_t *
mongoc_stream_gridfs_new (mongoc_gridfs_file_t *file);
```

## PARAMETERS

- •

  **file**: A *mongoc\_gridfs\_file\_t*.

This function shall create a new *mongoc\_stream\_t* to read from and write to a GridFS file. GridFS files are created with *mongoc\_gridfs\_create\_file()* or *mongoc\_gridfs\_create\_file\_from\_stream()*.

This function does not transfer ownership of **file**. Therefore, **file** must remain valid for the lifetime of this stream.

## RETURNS

A newly allocated *mongoc\_stream\_t* if successful, otherwise **NULL**.

Note, the returned stream ignores read and write timeouts passed to *mongoc\_stream\_readv()*, *mongoc\_stream\_writev()*, and so on. It uses the "socketTimeoutMS" and "connectTimeoutMS" values from the MongoDB URI.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
