WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Return next matching file information (after a findfirst)
Continue a search to iterate through a list of files
None
Array of the next matching file containing the following keys and values:
KEY | TYPE | VALUE |
---|---|---|
filename | string | Name of the file |
attributes | int | FAT file attributes |
filesize | int | File size in bytes |
timestamp | int | FAT timestamp of last save |
<pre><? chdir("/logs"); // change to the logs folder $arr=findfirst("*.*",255); // get the first entry matching any file or directory while ($arr) { print_r($arr); print("\r\n"); $arr=findnext(); // get another matching file/directory } ?></pre>
Typical output for the above example (results vary depending on the contents of the /logs directory):
[$arr] = Array ( (string) [filename] => . (int) [attributes] => 16 (int) [filesize] => 0 (int) [timestamp] => 1218599393 ) [$arr] = Array ( (string) [filename] => .. (int) [attributes] => 16 (int) [filesize] => 0 (int) [timestamp] => 1218599393 ) [$arr] = Array ( (string) [filename] => ahcount.ini (int) [attributes] => 32 (int) [filesize] => 570 (int) [timestamp] => 1248149344 ) [$arr] = Array ( (string) [filename] => 2017 (int) [attributes] => 16 (int) [filesize] => 0 (int) [timestamp] => 1247484896 ) [$arr] = Array ( (string) [filename] => log.txt (int) [attributes] => 32 (int) [filesize] => 9888 (int) [timestamp] => 1248147596 ) [$arr] = Array ( (string) [filename] => log_0.ini (int) [attributes] => 32 (int) [filesize] => 517 (int) [timestamp] => 1248149344 ) [$arr] = Array ( (string) [filename] => daily_kwh.csv (int) [attributes] => 32 (int) [filesize] => 639 (int) [timestamp] => 1248133120 )
findfirst() - Start searching the current folder for files matching a pattern and attributes
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
print_r() - Dump the contents of an array to the current output