---
name: "gfs_glob"
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_glob"
---

# gfs\_glob(3)

find path names matching a pattern

## NAME

gfs\_glob - find path names matching a pattern

## SYNOPSIS

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

**char \*gfs\_glob (const char \*** *pattern***, gfarm\_stringlist \*** *paths***, gfs\_glob\_t \*** *types***);**

## DESCRIPTION

**gfs\_glob()** searches for all the path names matching *pattern* that may include a wildcard, and returns *paths*.

The returned path names are accessed by gfarm\_stringlist\_length(3) and gfarm\_stringlist\_elem(3).

It is necessary to allocate memory space dynamically pointed to by *types* using **[gfs\_glob\_init(3)](/gfs_glob_init/3.md)** before calling **[gfs\_glob(3)](/gfs_glob/3.md)**.  The allocated memory space needs to be free'ed by [gfs\_glob\_free(3)](/gfs_glob_free/3.md).

## RETURN VALUES

- **NULL**

  The function terminated successfully.

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

  Insufficient memory was available.

- **GFARM\_ERR\_PATHNAME\_TOO\_LONG**

  Too long pattern or path name to process.

- **Others**

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

## SEE ALSO

[**gfs\_glob\_init**(3)](/gfs_glob_init/3.md) [**gfs\_glob\_free**(3)](/gfs_glob_free/3.md) **gfarm\_stringlist\_init**(3) **gfarm\_stringlist\_length**(3) **gfarm\_stringlist\_elem**(3) **gfarm\_stringlist\_free**(3) **gfarm\_stringlist\_free\_deeply**(3)
