scp command

Aug 4, 2011 at 3:16 PM

can this lib support scp command?

how can i do?

Coordinator
Aug 5, 2011 at 1:55 PM

Hi,

 

I already have and issue open to add SCP support but I think I have some other feature that you might find usefull.

Please take a look at SftpFileStream class, unfortunatly I dont have many examples of this feature yet, as it was added recently, but the basic idea behind it is to be able to open, read and write to the file remotly as it would be local.

And of course if you can read and write it you can implement SCP functionality that you need.

Here is an example of SftpFileStrea:

            using (var sftp = new SftpClient(connectionInfo))
            {
                sftp.Connect();
                var file = sftp.OpenText("test.txt");
                var content = file.ReadToEnd();
                Console.WriteLine(content);
                sftp.Disconnect();
            }

Hope it helps,

Thanks,

Oleg