Arduino-Ftp-Server icon indicating copy to clipboard operation
Arduino-Ftp-Server copied to clipboard

Questions & Date Addition to code

Open watarat opened this issue 6 years ago • 0 comments

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
  1. 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.

watarat avatar May 29 '19 03:05 watarat