DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
vfs.h File Reference

Unified virtual filesystem wrapper (DETWS_ENABLE_VFS). More...

#include "ServerConfig.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Unified virtual filesystem wrapper (DETWS_ENABLE_VFS).

One small file API the rest of the library and the application can target, backed by a pluggable store. Two backends ship:

  • RAM (built-in, host-testable, zero-heap): a fixed pool of DETWS_VFS_RAM_FILES files of up to DETWS_VFS_RAM_FILE_SIZE bytes each, all in BSS - deterministic, bounded, and the same on host and ESP32. Ideal as a scratch / test / RAM-disk store.
  • Arduino FS (ESP32 only): wraps a real fs::FS (LittleFS / SD / SPIFFS) for persistent storage. Mount it with detws_vfs_mount(detws_vfs_fs(&LittleFS)).

The point is a single seam: a feature (a config store, the audit-log sink, a template loader, an upload target) calls detws_vfs_* and works against whichever backend the application mounted - RAM in tests, flash or SD in production - without knowing which. Handles are small ints the backend assigns; the API fails closed (-1 / false) when nothing is mounted or a bound is hit.

Single-accessor like the other services: use it from one context (a worker / loop), not concurrently.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file vfs.h.