18 #include <spiffs_sming.h> Create new file if file does not exist.
Definition: FileSystem.h:30
Truncate file.
Definition: FileSystem.h:32
int32_t fileTell(file_t file)
Get position in file.
int fileSetContent(const String &fileName, const char *content, int length=-1)
Create or replace file with defined content.
int fileRead(file_t file, void *data, size_t size)
Read from file.
void fileClose(file_t file)
Clode file.
constexpr SeekOrigin eSO_CurrentPos
Definition: FileSystem.h:43
signed short file_t
File handle.
Definition: FileSystem.h:23
int fileTruncate(file_t file, size_t newSize)
Truncate (reduce) the size of an open file.
constexpr SeekOrigin eSO_FileStart
File seek flags.
Definition: FileSystem.h:42
The String class.
Definition: WString.h:136
void fileClearLastError(file_t fd)
Clear last file system error.
int fileLastError(file_t fd)
Get last file system error code.
bool fileExist(const String &name)
Check if a file exists on file system.
#define SPIFFS_APPEND
Definition: spiffs.h:156
SeekOrigin
Stream/file seek origins.
Definition: SeekOrigin.h:18
int fileDelete(const String &name)
Delete file.
int fileSeek(file_t file, int offset, SeekOrigin origin)
Position file cursor.
SEEK_CUR: Current position in file.
bool fileIsEOF(file_t file)
Check if at end of file.
#define SPIFFS_TRUNC
Definition: spiffs.h:159
Vector< String > fileList()
Get list of files on file system.
Read only file.
Definition: FileSystem.h:27
#define SPIFFS_WRONLY
Definition: spiffs.h:168
int fileStats(const String &name, spiffs_stat *stat)
String fileGetContent(const String &fileName)
Read content of a file.
#define SPIFFS_CREAT
Definition: spiffs.h:162
file_t fileOpen(const String &name, FileOpenFlags flags)
Open file.
Append to file.
Definition: FileSystem.h:31
int fileWrite(file_t file, const void *data, size_t size)
Write to file.
#define SPIFFS_RDONLY
Definition: spiffs.h:165
static FileOpenFlags operator|(FileOpenFlags lhs, FileOpenFlags rhs)
Definition: FileSystem.h:36
Create new file even if file exists.
Definition: FileSystem.h:33
constexpr SeekOrigin eSO_FileEnd
Definition: FileSystem.h:44
int fileRename(const String &oldName, const String &newName)
Rename file.
FileOpenFlags
File open flags.
Definition: FileSystem.h:26
int fileFlush(file_t file)
Flush pending writes.
Read and write file.
Definition: FileSystem.h:29
Write only file.
Definition: FileSystem.h:28
uint32_t fileGetSize(const String &fileName)
Get size of file.