SdFat icon indicating copy to clipboard operation
SdFat copied to clipboard

latest version no longer compatible with webserver.h

Open MartinNohr opened this issue 3 years ago • 1 comments

I switched to the latest version from 2.0.7. I am getting this error now: WebServer.h: 141:5: error: call to 'StreamFile<FsBaseFile, long long unsigned int>::name' declared with attribute error: use getName(name, size) _streamFileCore(file.size(), file.name(), contentType)

MartinNohr avatar Aug 13 '22 22:08 MartinNohr

Before the latest version I returned an error message instead of the correct file name.

  /** No longer implemented due to Long File Names.
   *
   * Use getName(char* name, size_t size).
   * \return a pointer to replacement suggestion.
   */
 const char* name() const {
    return "use getName()";
  }

This causes applications to fail with no error so I made this a hard error in the latest version of SdFat.

  /** No longer implemented due to Long File Names.
   *
   * Use getName(char* name, size_t size).
   */
  char* __attribute__((error("use getName(name, size)"))) name();

It would require almost 1 KB of RAM per file to implement this function for long utf8 file names and SdFat would no longer run on Uno.

greiman avatar Aug 14 '22 11:08 greiman