findfirst

(FW >= 1.0)

findfirst - finds the first file matching a pattern

Description

array findfirst(string pattern, int flags)
This will begin a search to iterate through a list of files

Parameters

pattern

partial or full pattern such as *.* or *.cgi

attributes

matching mask, leave at 255 to include all.  See FAT file attributes for more information

Return Value

Array of the first matching element.  The array will contain the following keys and values: 
filename - name of the file
attributes - file attributes (FAT)
filesize - file size in bytes
timestamp - FAT timestamp of last save

Examples

<pre><?
// change to the root folder

chdir("/");

// get the first entry matching any file, excluding directories
$arr=findfirst("*.*",255-16);

while ($arr) {
print($arr['filename']."\r\n");
$arr=findnext();
}
?>
</pre>