Reputation: 15896
I'm new to SFTP and recently started using WinSCP at my work. We authenticate to the SFTP server using a private key. We are building an error-log parser that fetches the error-log of our server through WinSCP once in a while (every 10 seconds or so), and parses it to display an overview of our errors visually (or play a sound if there have been many errors lately).
Now, I suppose that SFTP is FTP, just based on a secure protocol. If I'm not mistaken, FTP supports partial filetransfers given an offset (say that I want to transfer everything after the first 1000 bytes for instance). The reason I need this functionality is that we want to reduce the load of the server, so that I only download the changes of the file.
My specific implementation is SharpSSH, but I am okay with switching to another SFTP solution if SharpSSH can't handle partial downloads.
Where do I begin? I tried Googling it but without results.
Upvotes: -1
Views: 475
Reputation: 15896
I ended up using SSH .NET. It works like a charm, and is a full free wrapper for .NET that supports partial transfers with private keys and everything.
Upvotes: -1
Reputation: 46070
SFTP is not FTP and has very little in common with FTP. However, you can use SFTP to access parts of the file. This requires use of low-level methods offered by SFTP, such as OpenFile, ReadFile and CloseHandle (those methods are very similar to usual filesystem operations but they are executed by the SFTP server). I doubt that SharpSSH or anything similar offers such method. Our SecureBlackbox does, though, so you can use it for your task.
Upvotes: 1