I also guess it's quite possible to port it to Linux (but I'm not a Linux code neither).
Well... With my zero knowledge of Linux-GUI/desktop programming I just went for it
(I only have experience with Linux servers at the command line
)
On the internet I only found commercial solutions for sFTP on Linux. So creating a working SimpleSFTP.pas could be interesting for more people.
Adding a function CopyMemory, changing winsock to synsock and removing Windows I only had to IFDEF out the GetLocalFileTimes and SetLocalFileTimes functions. I think they are only used in (and after) the real getting and putting of files. For me it was only to test if I got this SimpleSFTP.pas running and connected under Linux. And it worked. I had a hell of a time installing CryptLib correctly (the beta 343 version didn't work) but finally cl342 did work.
Here is the result connecting from Linux to a SFTP_2000.exe server (
I got from here) running on a Windows 7 machine. The adjusted SimpleSFTP.pas is also attached.
As you can see it connects correctly and I get the directory-result from the server. The factual transference of files doesn't work (yet). You'll get some errors. But it shows that using this SimpleSFTP.pas isn't as hard as we initially thought.
@xinyiman, if you interested in help perfecting this SimpleSFTP.pas, let us know.