sftp ReadDirectory
Posted: Tue 26 Jun 2018 13:44
Hello,
can anyone help me, what would be the problem: there's a procedure (Delphi, XE2) based on a demo, to read a remote directory from a server. When it runs first time, it reads succesfully. But any other occasions, after SFTP.OpenDirectory() gave back a handle, the SFTP client's EOF remains TRUE, so SFTP.ReadDirectory(Hdl) inside of the while-cycle won't be executed. I don't understand why.
(this procedure worked well with the 60 days trial version)
Has anyone any idea?
thanks,
Gábor
//------------------------------
procedure TForm1.ReadDir;
var n,i:integer;
Hdl:tScSFTPFileHandle; apUPLMAP:String;
begin
Hdl := SFTP.OpenDirectory(apUPLMAP);
try
while not SFTP.EOF do begin
SFTP.ReadDirectory(Hdl);
end;
finally
SFTP.CloseHandle(Hdl);
end;
end;
//---------------------------
can anyone help me, what would be the problem: there's a procedure (Delphi, XE2) based on a demo, to read a remote directory from a server. When it runs first time, it reads succesfully. But any other occasions, after SFTP.OpenDirectory() gave back a handle, the SFTP client's EOF remains TRUE, so SFTP.ReadDirectory(Hdl) inside of the while-cycle won't be executed. I don't understand why.
(this procedure worked well with the 60 days trial version)
Has anyone any idea?
thanks,
Gábor
//------------------------------
procedure TForm1.ReadDir;
var n,i:integer;
Hdl:tScSFTPFileHandle; apUPLMAP:String;
begin
Hdl := SFTP.OpenDirectory(apUPLMAP);
try
while not SFTP.EOF do begin
SFTP.ReadDirectory(Hdl);
end;
finally
SFTP.CloseHandle(Hdl);
end;
end;
//---------------------------