---
name: "gfs_readdir"
section: "3"
platform: "linux"
package: "libgfarm-dev"
version: "2.4.1-1.1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/gfs_readdir"
---

# gfs\_readdir(3)

read directory entry

## NAME

gfs\_readdir - read directory entry

## SYNOPSIS

**#include \<gfarm/gfarm.h\>**

**char \*gfs\_readdir (GFS\_Dir** *dir***, struct gfs\_dirent \*\*** *entryp***);**

## DESCRIPTION

The **gfs\_readdir()** function reads a directory entry from *dir*, and returns the pointer of the entry to the address pointed to by *entryp*.  The buffer pointed to by *entryp* is destroyed when calling succeeding **gfs\_readdir()** or **gfs\_closedir()** with the same argument *dir*.

## RETURN VALUES

- **NULL**

  The function terminated successfully.

- **Others**

  An error except the above occurred.  The reason is shown by its pointed strings.

## SEE ALSO

[**gfs\_closedir**(3)](/gfs_closedir/3.md), [**gfs\_opendir**(3)](/gfs_opendir/3.md), [**gfs\_readdir**(3)](/gfs_readdir/3.md)
