Arduino Posix Filesystems
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
file_systems::FileSystemSD Class Reference

We provide the posix file operations with the help of the SD library. For the ESP32 we set up a virtual file system. More...

#include <FileSystemSD.h>

Inheritance diagram for file_systems::FileSystemSD:
file_systems::FileSystemBase

Public Member Functions

 FileSystemSD (const char *name, ES_SD &sd)
 
 FileSystemSD (const char *name)
 
void setSD (ES_SD &sd)
 
void setFileSystemForSearch ()
 Selects the actual File System to be used for directory searches.
 
int open (const char *path, int flags, int mode) override
 
ssize_t write (int fd, const void *data, size_t size) override
 
ssize_t read (int fd, void *data, size_t size) override
 
int close (int fd) override
 
int fstat (int fd, struct stat *st) override
 
int stat (const char *path, struct stat *st) override
 
off_t lseek (int fd, off_t offset, int mode) override
 
DIRopendir (const char *path) override
 
direntreaddir (DIR *dir) override
 
int closedir (DIR *pdir) override
 
virtual const char * name () override
 
- Public Member Functions inherited from file_systems::FileSystemBase
 FileSystemBase (const char *path)
 Constructor for a new file system. More...
 
virtual const char * pathPrefix ()
 Provides the path for all relevant files managed by this file system.
 
virtual bool isValidFile (const char *path)
 Checks if the file is managed by this file system. More...
 
 operator bool ()
 
virtual const char * name ()
 
virtual int open (const char *path, int flags, int mode)
 
virtual ssize_t write (int fd, const void *data, size_t size)
 
virtual ssize_t read (int fd, void *data, size_t size)
 
virtual int close (int fd)
 
virtual int fstat (int fd, struct stat *st)
 
virtual int stat (const char *pathname, struct stat *statbuf)
 
virtual off_t lseek (int fd, off_t offset, int mode)
 
virtual off_t tell (int fd)
 
virtual DIRopendir (const char *name)
 
virtual direntreaddir (DIR *pdir)
 
virtual int closedir (DIR *pdir)
 
virtual int unlink (const char *path)
 
virtual void * mem_map (const char *path, size_t *p_size)
 
virtual bool is_readonly ()
 

Protected Member Functions

void setup (const char *path)
 
ES_SD & getFS ()
 
File & getFile (int fd)
 
int addOpenFile (const char *path, File &file)
 
- Protected Member Functions inherited from file_systems::FileSystemBase
virtual int filenameOffset ()
 The ESP32 is removing the path prefix for all file processing.
 
const char * internalFileName (const char *name, bool withPrefix)
 

Protected Attributes

ES_SD * p_fs = nullptr
 
Vector< File * > files
 
const char * FS_NAME_SD = "FileSystemSD"
 
esp_vfs_t myfs
 
- Protected Attributes inherited from file_systems::FileSystemBase
const char * path_prefix = "@"
 
int filename_offset = 0
 
esp_vfs_t myfs
 

Additional Inherited Members

- Static Public Member Functions inherited from file_systems::FileSystemBase
static const char * standardName (const char *name)
 file name w/o leading /
 

Detailed Description

We provide the posix file operations with the help of the SD library. For the ESP32 we set up a virtual file system.

Author
Phil Schatzmann

Member Function Documentation

◆ close()

int file_systems::FileSystemSD::close ( int  fd)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ closedir()

int file_systems::FileSystemSD::closedir ( DIR pdir)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ fstat()

int file_systems::FileSystemSD::fstat ( int  fd,
struct stat st 
)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ lseek()

off_t file_systems::FileSystemSD::lseek ( int  fd,
off_t  offset,
int  mode 
)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ name()

virtual const char * file_systems::FileSystemSD::name ( )
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ open()

int file_systems::FileSystemSD::open ( const char *  path,
int  flags,
int  mode 
)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ opendir()

DIR * file_systems::FileSystemSD::opendir ( const char *  path)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ read()

ssize_t file_systems::FileSystemSD::read ( int  fd,
void *  data,
size_t  size 
)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ readdir()

dirent * file_systems::FileSystemSD::readdir ( DIR dir)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ stat()

int file_systems::FileSystemSD::stat ( const char *  path,
struct stat st 
)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.

◆ write()

ssize_t file_systems::FileSystemSD::write ( int  fd,
const void *  data,
size_t  size 
)
inlineoverridevirtual

Reimplemented from file_systems::FileSystemBase.


The documentation for this class was generated from the following file: