/
dinruspro
/
reference
Обзор
Документация
Войти
/
dinruspro
/
reference
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
SshBasics/Exec.cpp
23 строки
511 B
EnergonV
Справка по коду перекочевала в репозиторий (наконец-то!)
09 янв 2024, 19:20
09 янв 2024, 19:20
e333663
Код
Авторство
О чём код?
#include "SshBasics.h" // ExecListDir: // Demonstrates a remote command execution. void ExecListDir(SshSession& session) { const char *cmdline = "ls -l /pub/example"; SshExec exec(session); String cout, cerr; int exit_code = exec(cmdline, cout, cerr); if(!exec.IsError()) { DUMP(exit_code); LOG("Stdout:\n" << cout); LOG("Stderr:\n" << cerr); return; } LOG(exec.GetErrorDesc()); // Or you can use one of the helper functions instead: // LOG("Stdout:\n" << SshExecute(session, cmdline)); }