Fixed LIST command of FTP server. It now returns something akin to 'ls -la'.

This commit is contained in:
Fabian Schlenz 2019-08-21 20:50:27 +02:00
parent 231b8a2bce
commit 0b82346599

View File

@ -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 <DIR> " + 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");