Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 make 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).
