EOF does not reset
Posted: Wed 14 Nov 2018 13:49
When I try to open a file, then read it and close it using closehandle. If I then try to open another file or the same file, then EOF is not set to false, but stays at True from last time.
System: Delphi XE5 Update 2, Windows 10 Pro, SecureBridge 8.2.4
I even tried to disconnect and reconnect without it being reset to false when I call Openfile.
Code:
System: Delphi XE5 Update 2, Windows 10 Pro, SecureBridge 8.2.4
I even tried to disconnect and reconnect without it being reset to false when I call Openfile.
Code:
Anyone have solution to this, its a pretty wierd if no one have seen it before ?var
Handle: TBytes;
Begin
ScSFTPClient1.connect;
For I := 0 to 5 do Begin //Loop, just for testing
Handle := ScSFTPClient1.OpenFile('/test/2018-01-05_panelists.txt', fmOpenExisting, [], [bmWrite, bmDelete], [amReadData]);
Try
//First time ScSFTPClient1.EOF is False, second time it stays True and the code inside While is not executed.
While not ScSFTPClient1.EOF do
//Do ScSFTPClient1.ReadFile here
Finally
CloseHandle(Handle);
end;
end;
ScSFTPClient1.Disconnect;