From 0b82346599171faf314c95664488fdc9e39fee15 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Wed, 21 Aug 2019 20:50:27 +0200 Subject: [PATCH] Fixed LIST command of FTP server. It now returns something akin to 'ls -la'. --- lib/esp8266FTPServer/ESP8266FtpServer.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/lib/esp8266FTPServer/ESP8266FtpServer.cpp b/lib/esp8266FTPServer/ESP8266FtpServer.cpp index d9c9bb9..76cf11d 100644 --- a/lib/esp8266FTPServer/ESP8266FtpServer.cpp +++ b/lib/esp8266FTPServer/ESP8266FtpServer.cpp @@ -418,26 +418,7 @@ boolean FtpServer::processCommand() File file = root.openNextFile(); while(file){ - if (parameters && strcmp(parameters, "-la")==0) { - data.printf("%s %13d Jan 01 00:00 %s\r\n", file.isDirectory() ? "drwxr-xr-x 1 owner group" : "-rw-r--r-- 1 owner group", file.size(), file.name()); - } else { - if(file.isDirectory()){ - data.println( "+r,s " + String(file.name())); - // Serial.print(" DIR : "); - // Serial.println(file.name()); - // if(levels){ - // listDir(fs, file.name(), levels -1); - // } - } else { - String fn, fs; - fn = file.name(); - // fn.remove(0, 1); - fs = String(file.size()); - data.println( "+r,s" + fs); - data.println( ",\t" + fn ); - nm ++; - } - } + data.printf("%s %13d Jan 01 00:00 %s\r\n", file.isDirectory() ? "drwxr-xr-x 1 owner group" : "-rw-r--r-- 1 owner group", file.size(), file.name()); file = root.openNextFile(); } client.println( "226 " + String(nm) + " matches total");