M2M_API_RESULT m2m_fs_find_first(CHAR *filename_buffer, CHAR *file_spec)
Description: the function finds the first file or directory having the name matching the provided pattern. To find the next files or directories matching the pattern, you must use the m2m_fs_find_next function.
Parameters:
filename_buffer: pointer to the allocated buffer that will be filled with the file name found.
file_spec: pointer to the zero-terminated string containing the pattern you want to find.
Return
value:
refer to
M2M_API_RESULT enum
Output data:
The first directory or file name matching the pattern is contained in the buffer using the format shown in the table below:
< directory name> |
‘\0’ |
|
the directory name is closed in angle brackets | |
(system file name) |
‘\t’ |
file size in bytes |
‘\0’ |
the system file name is closed in parentheses |
user file name |
‘\t’ |
file size in bytes |
‘\0’ |
the user file name is not closed in parentheses |
NOTE: file_spec may include full path with drive and separators, example: "A:\MOD\m2mapz.bin".
Examples: 19.1.2 Listing all Files