Skip to content

Commit

Permalink
FS doc update (#2404)
Browse files Browse the repository at this point in the history
FSInfo64 removed and FSInfo updated. File name length limitation of LittleFS changed to 255 characters
  • Loading branch information
jlbirccyn authored Sep 1, 2024
1 parent bc7adf4 commit 6a5f98c
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions docs/fs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ LittleFS File System Limitations
--------------------------------

The LittleFS implementation for the RP2040 supports filenames of up
to 31 characters + terminating zero (i.e. ``char filename[32]``), and
as many subdirectories as space permits.
to 254 characters + terminating zero (i.e. ``char filename[255]`` or
better ``char filename[LFS_NAME_MAX]`` ), and as many subdirectories
as space permits.

Filenames are assumed to be in the root directory if no initial "/" is
present.
Expand Down Expand Up @@ -372,8 +373,8 @@ rename
Renames file from ``pathFrom`` to ``pathTo``. Paths must be absolute.
Returns *true* if file was renamed successfully.

info **DEPRECATED**
~~~~~~~~~~~~~~~~~~~~
info
~~~~

.. code:: cpp
Expand All @@ -382,18 +383,17 @@ info **DEPRECATED**
Fills `FSInfo structure <#filesystem-information-structure>`__ with
information about the file system. Returns ``true`` if successful,
``false`` otherwise. Because this cannot report information about
filesystemd greater than 4MB, don't use it in new code. Use ``info64``
instead which uses 64-bit fields for filesystem sizes.
``false`` otherwise. ``ìnfo()`` has been updated to support filesystems
greater than 4GB and ``FSInfo64`` and ``info64()`` have been discarded.

Filesystem information structure
--------------------------------

.. code:: cpp
struct FSInfo {
size_t totalBytes;
size_t usedBytes;
uint64_t totalBytes;
uint64_t usedBytes;
size_t blockSize;
size_t pageSize;
size_t maxOpenFiles;
Expand All @@ -408,19 +408,6 @@ block size - ``pageSize`` — filesystem logical page size - ``maxOpenFiles``
``maxPathLength`` — max file name length (including one byte for zero
termination)

info64
~~~~~~

.. code:: cpp
FSInfo64 fsinfo;
SDFS.info64(fsinfo);
or LittleFS.info64(fsinfo);
Performs the same operation as ``info`` but allows for reporting greater than
4GB for filesystem size/used/etc. Should be used with the SD and SDFS
filesystems since most SD cards today are greater than 4GB in size.

setTimeCallback(time_t (\*cb)(void))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 6a5f98c

Please sign in to comment.