======findfirst====== WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0 Start searching the current folder for files matching a pattern and attributes ====Description==== array findfirst ( string $pattern, int $attributes ) 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 [[software:os:fat_file_system#attributes|FAT file attributes]] for more information. ====Return Values==== Array of the first matching file containing the following keys and values: ^KEY^TYPE^VALUE^ |filename|string|Name of the file| |attributes|int|[[software:os:fat_file_system#attributes|FAT file attributes]]| |filesize|int|File size in bytes| |timestamp|int|[[software:os:fat_file_system#timestamps|FAT timestamp of last save]]| ====Example==== ===List all files in the root directory===
====Also See==== [[findnext()]] - Return next matching file information (after a findfirst) [[timefromfat()]] - Convert a FAT filetime to a Linux Timestamp [[strftime()]] - Format a Linux Timestamp using a format string [[chdir()]] - Change the current directory [[file_exists()]] - Check if a file exists [[filesize()]] - Return the size of a file, or the number of unread bytes in a stream or socket