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

struct Spawn {
string allData;
HANDLE inWritePipe;
HANDLE outReadPipe;
OVERLAPPED overlapped;
ubyte[4096] overlappedBuffer;
}

Members

Functions

cleanup
void cleanup()

On windows, calls CloseHandle on the io handles Spawn uses Does nothing on linux as linux automatically closes resources when parent dies

readNextChunk
void readNextChunk()

Returns the next toRead of data as a string

sendData
void sendData(string command)

Sends command to the pty

Meta