mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
21 lines
473 B
C++
21 lines
473 B
C++
#include <Core/Core.h>
|
|
#include <Core/SSH/SSH.h>
|
|
|
|
using namespace Upp;
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
StdLogSetup(LOG_COUT|LOG_FILE);
|
|
// Ssh::Trace();
|
|
|
|
const char *file = "/pub/example/readme.txt";
|
|
|
|
SshSession session;
|
|
if(session.Timeout(30000).Connect("demo:password@test.rebex.net:22")) {
|
|
SFtp sftp = session.CreateSFtp();
|
|
String out = sftp.LoadFile(file);
|
|
LOG((!sftp.IsError() ? out : sftp.GetErrorDesc()));
|
|
}
|
|
else
|
|
LOG(session.GetErrorDesc());
|
|
}
|