parameters: (self, IOP)
docstring: Called for io operations. We read from pipe into buffers or on restore
          create a file for each database and write into it.
docstring_summary: Called for io operations. We read from pipe into buffers or on restore
          create a file for each database and write into it.
docstring_tokens: Called for io operations . We read from pipe into buffers or on restore create a file for each database and write into it .
function: def plugin_io(self, IOP):
          '''
          Called for io operations. We read from pipe into buffers or on restore
          create a file for each database and write into it.
          '''
          DebugMessage(
              100,
              "plugin_io called with " + str(IOP.func) + "\n"
          )
  
          if IOP.func == IO_OPEN:
              try:
                  if IOP.flags & (os.O_CREAT | os.O_WRONLY):
                      self.file = open(IOP.fname, 'wb');
              except Exception,msg:
                  IOP.status = -1;
                  DebugMessage(
                      100,
                      "Error opening file: " + IOP.fname + "\n"
                  )
                  print msg;
                  return bRC_Error
              return bRC_OK
  
          elif IOP.func == IO_READ:
              IOP.buf = bytearray(IOP.count)
              IOP.status = self.stream.stdout.readinto(IOP.buf)
              IOP.io_errno = 0
              return bRC_OK
          
          elif IOP.func == IO_WRITE:
              try:
                  self.file.write(IOP.buf);
                  IOP.status = IOP.count
                  IOP.io_errno = 0
              except IOError,msg:
                  IOP.io_errno = -1
                  DebugMessage(
                      100,
                      "Error writing data: " + msg + "\n"
                  )
              return bRC_OK
  
          elif IOP.func == IO_CLOSE:
              if self.file:
                  self.file.close()
              return bRC_OK
          
          elif IOP.func == IO_SEEK:
              return bRC_OK
          
          else:
              DebugMessage(
                  100,
                  "plugin_io called with unsupported IOP:" + str(IOP.func) + "\n"
              )
              return bRC_OK
function_tokens: def plugin_io ( self , IOP ) : DebugMessage ( 100 , "plugin_io called with " + str ( IOP . func ) + "\n" ) if IOP . func == IO_OPEN : try : if IOP . flags & ( os . O_CREAT | os . O_WRONLY ) : self . file = open ( IOP . fname , 'wb' ) except Exception , msg : IOP . status = - 1 DebugMessage ( 100 , "Error opening file: " + IOP . fname + "\n" ) print msg return bRC_Error return bRC_OK elif IOP . func == IO_READ : IOP . buf = bytearray ( IOP . count ) IOP . status = self . stream . stdout . readinto ( IOP . buf ) IOP . io_errno = 0 return bRC_OK elif IOP . func == IO_WRITE : try : self . file . write ( IOP . buf ) IOP . status = IOP . count IOP . io_errno = 0 except IOError , msg : IOP . io_errno = - 1 DebugMessage ( 100 , "Error writing data: " + msg + "\n" ) return bRC_OK elif IOP . func == IO_CLOSE : if self . file : self . file . close ( ) return bRC_OK elif IOP . func == IO_SEEK : return bRC_OK else : DebugMessage ( 100 , "plugin_io called with unsupported IOP:" + str ( IOP . func ) + "\n" ) return bRC_OK