8000 Add SdFat beta to the list of supported libraries · Issue #1882 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Add SdFat beta to the list of supported libraries #1882

@aalku

Description

@aalku

Basic Infos

Hardware

Hardware: ESP-12 or 12E, I don't know
Core Version: 2.1.0

Description

I would like to get long filename support on SD.

This SdFat fork got it.
https://github.com/tannewt/SdFat/

There are small use differences with SD. Most serious is you have to pass a buffer to get a file name.

I'm using this around it:

String getFilename(File f) {
  char buff[256] = "";
  f.getName(buff, 256);
  return String(buff) + "";
}

+"" is because I don't know if String wraps the passed buffer or copies it.

I had to remove before write to overwrite too:

if (SD.exists(filename.c_str())) {
  SD.remove(filename.c_str());
}
fsUploadFile = SD.open(filename.c_str(), FILE_WRITE);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0