Hey everyone.
I'm writing a small ftp client for fun, using synapse (TFTPSend) and i wanna make a procedure to list everything in its folder and every subfolder.
Trying to use the same method as TSearchRec i came up with something like this:
var
FTP: TFTPSend;
procedure TFtpSync.ListAllFiles(const aDir: string);
var
i: integer;
s: string;
begin
FTP.List(aDir, false);
for i := 0 to FTP.FtpList.Count - 1 do begin
s := aDir + '/' + FTP.FtpList[i].FileName;
WriteLn(s);
if FTP.FtpList[i].Directory then begin
// FTP.ChangeWorkingDir(s);
ListAllFiles(s);
end;
end;
end;
..but it's not working as supposed to. I'd really appreciate it if someone could give me a tip or a small example.
Thank you in advance~!