mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 14:16:09 -06:00
21 lines
No EOL
449 B
C++
21 lines
No EOL
449 B
C++
#include "SshBasics.h"
|
|
|
|
// SFtpStreamGet:
|
|
// Demonstrates a basic stream operation on an sftp remote file object.
|
|
|
|
void SFtpStreamGet(SshSession& session)
|
|
{
|
|
const char *path = "/readme.txt";
|
|
|
|
SFtp sftp(session);
|
|
SFtpFileIn fi(sftp, path);
|
|
while(!fi.IsEof()) {
|
|
int64 pos = fi.GetPos();
|
|
String line = fi.GetLine();
|
|
if(!line.IsEmpty())
|
|
LOG(Format("Offset: %3d, Line: [%s]", pos, line));
|
|
}
|
|
if(fi.IsError())
|
|
LOG(fi.GetErrorText());
|
|
|
|
} |