def exec(cmd)
      # Send command
      @write1.puts cmd

      # Wait for response
      text = @read2.read

      # Close previous pipe
      @read2.close

      # Create new pipe
      @read2, @write2 = IO.pipe

      # Raise at the end to support continuing
      raise Client::RuntimeError, text if text.start_with? 'NT_STATUS_'

      text
    end
def exec(cmd)
      # Send command
      @write1.puts cmd

      # Wait for response
      text = @read2.read

      # Close previous pipe
      @read2.close

      # Create new pipe
      @read2, @write2 = IO.pipe

      # Raise at the end to support continuing
      raise Client::RuntimeError, text if text.start_with? 'NT_STATUS_'

      text
    end
Execute a smbclient command
 @param [String] cmd The command to be executed