---
name: "readclose"
section: "3"
platform: "linux"
package: "libowfat-dev"
version: "0.32-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/readclose"
---

# readclose(3)

read a whole file into a stralloc

## NAME

readclose - read a whole file into a stralloc

## SYNTAX

**#include \<libowfat/readclose.h\>**

int **readclose**(int fd,stralloc\* *sa*,size\_t *bufsize*);

## DESCRIPTION

readclose reads the whole content into the stralloc *sa*.  The file is read in chunks of *bufsize* bytes size.  If everything worked fine, readclose returns 0.  On error, readclose returns -1 and sets errno appropriately.

## SEE ALSO

[open\_read(3)](/open_read/3.md), [openreadclose(3)](/openreadclose/3.md), [readclose\_append(3)](/readclose_append/3.md)
