---
name: "TSfgets"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSfgets"
---

# TSfgets(3ts)

TSfgets API function

## NAME

TSfgets - TSfgets API function

## SYNOPSIS

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

- **char \*TSfgets(*TSFile* filep, char \*buf, size\_t length)**

  ## DESCRIPTION

Reads a line from the file pointed to by *filep* into the buffer *buf*.

Lines are terminated by a line feed character, ' '.  The line placed in the buffer includes the line feed character and is terminated with a **NULL**.  If the line is longer than length bytes then only the first length-minus-1 bytes are placed in *buf*.

## COPYRIGHT

2026, dev@trafficserver.apache.org
