---
name: "pcap_file"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pcap_file"
---

# pcap\_file(3)

get the standard I/O stream for a savefile being read

## NAME

pcap\_file - get the standard I/O stream for a savefile being read

## SYNOPSIS

```
#include <pcap/pcap.h>
```

**FILE \*pcap\_file(pcap\_t \*p);**

## DESCRIPTION

**pcap\_file**() returns the standard I/O stream of the \`\`savefile'', if a \`\`savefile'' was opened with [**pcap\_open\_offline**(3)](/pcap_open_offline/3.md), or **NULL**, if a network device was opened with [**pcap\_create**(3)](/pcap_create/3.md) and [**pcap\_activate**(3)](/pcap_activate/3.md), or with [**pcap\_open\_live**(3)](/pcap_open_live/3.md).

Note that the Packet Capture library is usually built with large file support, so the standard I/O stream of the \`\`savefile'' might refer to a file larger than 2 gigabytes; applications that use **pcap\_file**() should, if possible, use calls that support large files on the return value of **pcap\_file**() or the value returned by [**fileno**(3)](/fileno/3.md) when passed the return value of **pcap\_file**().

## SEE ALSO

[**pcap**(3)](/pcap/3.md)
