---
name: "gfs_opendir"
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_opendir"
---

# gfs\_opendir(3)

open a directory

## NAME

gfs\_opendir - open a directory

## SYNOPSIS

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

**char \*gfs\_opendir (const char \*** *gfarm\_url***, GFS\_Dir \*** *dirp***);**

## DESCRIPTION

The **gfs\_opendir()** function opens a directory stream corresponding to the directory *gfarm\_url*, and returns the directory stream to the address pointed by *dirp*.  The stream is positioned at the first entry in the directory.

## RETURN VALUES

- **NULL**

  The function terminated successfully.

- **GFARM\_ERR\_NO\_MEMORY**

  Insufficient memory was available.

- **GFARM\_ERR\_AUTHENTICATION**

  User authentication failed when connecting to [gfmd(8)](/gfmd/8.md).

- **GFARM\_ERR\_PERMISSION\_DENIED**

  *gfarm\_url* points outside your accessible address space.

- **GFARM\_ERR\_NO\_SUCH\_OBJECT**

  Directory does not exist.

- **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\_readdir**(3)](/gfs_readdir/3.md)
