Skip to content

Instantly share code, notes, and snippets.

@optik-aper
Created July 19, 2018 18:09
Show Gist options
  • Save optik-aper/97f8fab8c15d3153738ffd94ed8b284d to your computer and use it in GitHub Desktop.
Save optik-aper/97f8fab8c15d3153738ffd94ed8b284d to your computer and use it in GitHub Desktop.
Error message
import osproc, streams, strutils, os
let l = ""
let ps = startProcess("/sbin/iwlist", "", ["wlp2s0", "scan"])
let s = outputStream(ps)
while s.readLine(l):
echo(l)
@optik-aper
Copy link
Author

Error: type mismatch: got <Stream, string>
but expected one of: 
proc readLine(f: File; line: var TaintedString): bool
  first type mismatch at position: 1
  required type: File
  but expression 's' is of type: Stream
proc readLine(f: File): TaintedString
  first type mismatch at position: 1
  required type: File
  but expression 's' is of type: Stream
proc readLine(s: Stream): TaintedString
  first type mismatch at position: 1
  required type: Stream
  but expression 's' is of type: Stream
proc readLine(s: Stream; line: var TaintedString): bool
  first type mismatch at position: 1
  required type: Stream
  but expression 's' is of type: Stream

expression: readLine(s, l)
  while s.readLine(l):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment