Delphi Example Code - WeOnlyDo Discussion board

Delphi Example Code (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Bret, Wednesday, September 07, 2005, 17:35 (7017 days ago)

The example code for the SFTP is too basic. I'm stuck in trying to waitfor events to finish.

I am looking for a more robust example that shows how to do more than one thing in procedure. for example:

begin
wodSFTP1.listNames;
wodSFTP1.putfile(FileName);
end;

The above lines will fail on PutFile() as ListNames has not completed.

Any help appreciated.

Email: bee ohh bee at 'bordwell.com' (those are read as: bob)

Re: Delphi Example Code

by wodSupport, Wednesday, September 07, 2005, 17:56 (7017 days ago) @ Bret

Bret,

the way you use it (sequentially, line per line..) you need to set Blocking property to True and it will work. Currently component works in async way and you cannot execute methods until previous completes. Blocking should solve that. Can you try?

Re: Delphi Example Code

by Bret, Wednesday, September 07, 2005, 22:29 (7016 days ago) @ wodSupport

Excellent, Thank You!

Now, Another problem

The following fails:

var
FileName : OleVariant;
begin
wodsftp1.ListNames;
FileName := 'c:file1.txt';
wodsftp1.PutFile(FileName);
FileName := 'C:file2.txt';
wodsftp1.PutFile(FileName);
end;

What happens is file1.txt gets sent, then file1.txt gets sent again, as if FileName is not being re-set. Have tried as seperate OleVariants (FileName1,FileName2 : OleVariant), but that fails too.

Thanks again for your earlier suggestion.

Bret,

the way you use it (sequentially, line per line..) you need to set Blocking property to True and it will work. Currently component works in async way and you cannot execute methods until previous completes. Blocking should solve that. Can you try?

Re: Delphi Example Code

by wodSupport, Wednesday, September 07, 2005, 22:30 (7016 days ago) @ Bret

Bret,

you didn't specify RemotePath, and (I assume) it's the same in both cases.

Also, please use absolute paths *always*, not relative.

Regards,
Kreso

Re: Delphi Example Code

by Bret, Wednesday, September 07, 2005, 22:44 (7016 days ago) @ wodSupport

Thats It! Thank you!

Love your tech support... oooh so fast!