gallegojm / Arduino-Ftp-Server

Ftp server for Arduino Due and Ethernet Shield or WIZ820io
40 stars 25 forks source link

Questions & Date Addition to code #2

Open watarat opened 5 years ago

watarat commented 5 years ago

Firstly thank you for this code :) I have 3 things.

  1. I have made a small addition to the code to return 'last modified' timestamps in the MLSD response - attached below, insert 5 lines & comment 1, at about line 561
  2. I haven't yet been able to test this - as I'm limited by the SD card speed, but the code has a strange size for FTP buffer size - does anyone know if is this optimal/better for speed, or 1024 as per notes?
    //#define FTP_BUF_SIZE 1024 //512   // size of file buffer for read/write
    #define FTP_BUF_SIZE 2*1460 //512   // size of file buffer for read/write
  3. I have this working fine with SPI SD and SD_MMC interfaces on ESP32, and I will probably need to make it work with Directories. I don't expect it will be that hard, but if anyone is interested or can help ...
// FileTime additions..
    time_t t = file.getLastWrite();
    struct tm * tmstruct = localtime(&t);
    char dtStr[ 15 ];
    sprintf( dtStr, "%04u%02u%02u%02u%02u%02u",(tmstruct->tm_year)+1900,(tmstruct->tm_mon)+1, tmstruct->tm_mday, tmstruct->tm_hour , tmstruct->tm_min, tmstruct->tm_sec);
    data.println( "Type=file;Size=" + fs + ";"+"modify=" + dtStr + "; " + fn);
//  data.println( "Type=file;Size=" + fs + ";"+"modify=20000101160656;" +" " + fn);

Thanks.