dexpect

Members

Classes

ExpectException
class ExpectException

Exceptions thrown during expecting data.

ExpectImpl
class ExpectImpl(OutputRange)

ExpectImpl spawns a process in a Spawn object. You then call expect("desired output"); sendLine("desired Input"); to interact with said process

Functions

ReadFileEx
BOOL ReadFileEx(HANDLE, LPVOID, DWORD, OVERLAPPED*, void*)

Reads from an IO device (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365468%28v=vs.85%29.aspx)

constructPathToExe
string constructPathToExe(string exe)

Searches all dirs on path for exe if required, or simply calls it if it's a relative or absolute path

readFromPty
string readFromPty(Pty pty)

Reads from a pty session Returns the string that was read

sendToPty
void sendToPty(Pty pty, string data)

Sends a string to a pty.

setNonBlocking
void setNonBlocking(Pty pty)

Sets the Pty session to non-blocking mode

spawnProcessInPty
Pty spawnProcessInPty(string program, string[] args)

Spawns a process in a pty session By convention the first arg in args should be == program

startChild
auto startChild(string program, string commandLine, bool pipeStderrToStdout = true)

this is good. best to call it with plink.exe so it can talk to unix note that plink asks for the password out of band, so it won't actually work like that. thus specify the password on the command line or better yet, use a private key file e.g. startChild!something("plink.exe", "plink.exe user@server -i key.ppk \"/home/user/terminal-emulator/serverside\"");

Structs

Pty
struct Pty

A data structure to hold information on a Pty session Holds its fd and a utility property to get its name

Spawn
struct Spawn

Holds information on how to spawn off subprocesses On Linux systems, it uses forkpty On Windows systems, it uses OVERLAPPED io on named pipes

Meta