From 972b4dbe334d0c25bcce1e93c4d70295735f4fdd Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Fri, 29 Oct 2021 22:00:52 +0800 Subject: [PATCH] Fix fatFS upload thanks @liqijian101 --- esp3d/src/include/version.h | 2 +- esp3d/src/modules/filesystem/flash/fat_esp32_filesystem.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/esp3d/src/include/version.h b/esp3d/src/include/version.h index 648c08ca..0e97b0ce 100644 --- a/esp3d/src/include/version.h +++ b/esp3d/src/include/version.h @@ -22,7 +22,7 @@ #define _VERSION_ESP3D_H //version and sources location -#define FW_VERSION "3.0.0.a106" +#define FW_VERSION "3.0.0.a107" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #endif //_VERSION_ESP3D_H diff --git a/esp3d/src/modules/filesystem/flash/fat_esp32_filesystem.cpp b/esp3d/src/modules/filesystem/flash/fat_esp32_filesystem.cpp index c64e77fb..c11d1827 100644 --- a/esp3d/src/modules/filesystem/flash/fat_esp32_filesystem.cpp +++ b/esp3d/src/modules/filesystem/flash/fat_esp32_filesystem.cpp @@ -257,7 +257,8 @@ void ESP_File::close() //reopen if mode = write //udate size + date if (_iswritemode && !_isdir) { - File ftmp = FFat.open(_filename.c_str()); + String s = _filename[0]=='/'?"":"/" + _filename; + File ftmp = FFat.open(s.c_str()); if (ftmp) { _size = ftmp.size(); _lastwrite = ftmp.getLastWrite();