Skip to content

SPIFFS File implementation of seek is non-standard for Arduino #2553

Closed
@Makuna

Description

@Makuna

Basic Infos

SPIFFS File implementation of seek is non-standard for Arduino

Description

All implementations of "seek" for Arduino File objects only take one param and assume seek from the front of the file.
The SPIFFs only implements one "seek" that requires a second param that defines the SeekMode. This makes it difficult to write code/libraries that will work across SD file objects and SPIFFs file objects.

The solution is change the SeekMode to have a default value of SeekSet or add another seek that doesn't take the second parameter.

FS.h

bool seek(uint32_t pos, SeekMode mode = SeekSet);

or

bool seek(uint32_t pos)
{
    seek(pos, SeekSet);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions