Directry file listing class Instance will be a vector of string class which holds the file name of given path.
Dependents: ika_shouyu_poppoyaki DirectoryList_Hello ika_shouyu_poppoyaki eVY1_SMF_player ... more
You are viewing an older revision! See the latest version
Homepage
What is this?¶
A class to list files of a directory (folder).
When the instance is made, it access to the directory information and keeps the file names as vector of strings.
This class can be used for any file system which is supported by mbed.
- LocalFileSystem
- MSCFileSystem (USB mass storage class)
- SD card (for the SD card operation, sample code is available.).
How to use?¶
The usage is very simple.
- Make a instance with path to the directory
- Check error status
- The file names are available as vector of strings inside of instance.
#include "mbed.h" #include "DirectoryList.h" LocalFileSystem local( "local" ); int main(void) { DirectoryList dir( "/local" ); if ( dir.error_check() ) error( "directory could not be opened\r\n" ); for ( int i = 0; i < dir.size(); i++ ) printf( "%s\r\n", dir[ i ].c_str() ); }
Import programDirectoryList_Hello
Sample code for DirectoryList class library
Information
The file names are in 8.3 format (old DOS type file name fomat: 8 characters file name with 3 characters suffix).