# GetNextFile

int GetNextFile (char fileName[]);

## Purpose

Gets the next file found in the search that GetFirstFile starts. On Windows, the order in which these functions return the file names is dependent on the file system type. With the NTFS and CDFS file systems, the names are returned in alphabetical order. With FAT file systems, the names are returned in the order the files were written to the disk, which may or may not be in alphabetical order.

## Parameters

Output
Name | Type | Description
fileName | string | The name of the next file found. fileName contains the basename and extension of the next matching file and must be at least MAX_FILENAME_LEN characters in length.

## Return Value

Name | Type | Description
result | integer | Result of the search.
Code | Description
0 | Success.
-1 | No more files found that match criteria.
-2 | GetFirstFile must be called before GetNextFile.