FTP server mdelete and NLST problem
Posted: Thu Apr 26, 2012 7:24 am
If y'all are trying to get mdelete working, you will need to modify the FTPD_ListFile() to allow for NLST as well as LIST ftp requirements. I suggest adding a bool argument that lets the callback know whether to return just the filename for NLST, or the full LIST info (file permissions, time/date, etc.).
The example EFFS-HTTP provides LIST information which is nice when doing a ftp dir, but which breaks mdelete because the ftp client gets a NLST full of the extraneous file info which is not a simple filename.
Of course, you could also create a new callback function as well, but it is a trivial change to the existing code for an added argument.
As implemented with the EFFS-HTTP callback:
[/code]
The example EFFS-HTTP provides LIST information which is nice when doing a ftp dir, but which breaks mdelete because the ftp client gets a NLST full of the extraneous file info which is not a simple filename.
Of course, you could also create a new callback function as well, but it is a trivial change to the existing code for an added argument.
As implemented with the EFFS-HTTP callback:
Code: Select all
FTPDCallBackReportFunct *pFunc, int socket, bool nlst )
{
......
if (nlst == true)
pFunc( socket, find.filename ); // just the filename please
else
{
getdirstring( &find, s ); // the full LIST monty with permissions, time/date, etc.
pFunc( socket, s );
}
.......
}