directories functions header added (from esp-idf/components/vfs)

This commit is contained in:
Joachim Burket
2020-06-30 14:34:39 +02:00
parent 62d3b0d9b7
commit 865644b64e
3 changed files with 4 additions and 39 deletions

View File

@ -133,44 +133,10 @@ namespace
}
#else
#if defined(ESP32)
#include <sys/unistd.h>
#include "esp_dirent.h"
#include <sys/stat.h>
const char dir_separators[] = "/";
namespace {
struct dirent {
const char *d_name;
};
struct DIR {
dirent ent;
DIR() { }
~DIR()
{
if (ent.d_name)
delete[] ent.d_name;
}
};
DIR* opendir(const char* path)
{
DIR* dir = new DIR;
dir->ent.d_name = 0;
// TODO implement (point the first file starting with 'path' in its name)
return dir;
}
dirent* readdir(DIR* dir)
{
// TODO: implement (point to the next file with 'path' in its name)
return &(dir->ent);
}
void closedir(DIR* dir)
{
delete dir;
}
}
#else
# include <dirent.h>
# include <sys/stat.h>