---
name: "pcap_file"
section: "3pcap"
platform: "linux"
package: "libpcap"
version: "1.11.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/pcap_file/3pcap"
---

# pcap\_file(3pcap)

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**(3PCAP), or a null pointer, if a network device was opened with **pcap\_create**(3PCAP) and **pcap\_activate**(3PCAP), or with **pcap\_open\_live**(3PCAP).

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**(3PCAP)
