class Rex::Post::Meterpreter::Extensions::Stdapi::Sys::ProcessSubsystem::IO

This class provides an input/output interface to an executed process’ standard input and output.

Public Class Methods

new(process) click to toggle source

Initializes the IO instance.

# File lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb, line 30
def initialize(process)
  self.process = process
end

Public Instance Methods

read(length = nil) click to toggle source

Reads data from the standard output handle of the executed process.

# File lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb, line 45
def read(length = nil)
  return process.channel.read(length)
end
write(buf) click to toggle source

Writes the supplied buffer to the standard input handle of the executed process.

# File lib/rex/post/meterpreter/extensions/stdapi/sys/process_subsystem/io.rb, line 38
def write(buf)
  return process.channel.write(buf)
end