From 03a9d5b71f809ce1b14c0a8a470e51c44295ed63 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Fri, 1 Jan 2021 08:41:36 +0100 Subject: [PATCH] Update xdrv_98_filesystem.ino --- tasmota/xdrv_98_filesystem.ino | 37 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/tasmota/xdrv_98_filesystem.ino b/tasmota/xdrv_98_filesystem.ino index 78b79a2be..90d36b51c 100644 --- a/tasmota/xdrv_98_filesystem.ino +++ b/tasmota/xdrv_98_filesystem.ino @@ -373,28 +373,28 @@ void UFS_ListDir(char *path, uint8_t depth) { if (!*(pp + 1)) pp++; char *cp = name; // osx formatted disks contain a lot of stuff we dont want - if (ufs_reject((char*)ep)) goto fclose; + if (!ufs_reject((char*)ep)) { - for (uint8_t cnt = 0; cnt1) { - strcat(path, "/"); + for (uint8_t cnt = 0; cnt1) { + strcat(path, "/"); + } + strcat(path, ep); + UFS_ListDir(path, depth + 4); + path[plen] = 0; + } else { snprintf_P(npath, sizeof(npath), UFS_FORM_SDC_HREF, WiFi.localIP().toString().c_str(), pp,ep); WSContentSend_P(UFS_FORM_SDC_DIRb, npath, ep, name, tstr, entry.size()); + } } - fclose: entry.close(); } dir.close(); @@ -405,8 +405,6 @@ uint8_t UFS_DownloadFile(char *file) { File download_file; WiFiClient download_Client; - //AddLog_P(LOG_LEVEL_INFO, PSTR("file not found %s"),file); - if (!ufsp->exists(file)) { AddLog_P(LOG_LEVEL_INFO, PSTR("file not found")); return 0; @@ -457,6 +455,7 @@ uint8_t UFS_DownloadFile(char *file) { // loop(); //} } + delay(0); } download_file.close(); download_Client.stop();