---
name: "al_findnext"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/al_findnext"
---

# al\_findnext(3alleg)

Finds the next file in a search started by al\_findfirst(). Allegro game programming library.

## NAME

al\_findnext - Finds the next file in a search started by al\_findfirst(). Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**int al\_findnext(struct al\_ffblk \*info);**

## DESCRIPTION

This finds the next file in a search started by al\_findfirst(). Example:

```
   if (al_findfirst("*.pcx", &info, 0) != 0)
      return;
   do {
      /* Do something useful here with info.name. */
   } while (al_findnext(&info) == 0);
   al_findclose(&info);
```

## RETURN VALUE

Returns zero if a match is found, non-zero if none is found or if an error occurred and, in the latter case, sets errno accordingly.

## SEE ALSO

[**al\_findfirst**(3alleg)](/al_findfirst/3alleg.md), [**al\_findclose**(3alleg)](/al_findclose/3alleg.md)
