Fool-proof method ;)
    
    
    proc runshell(command: string): string =
      
      let (output, _) = execCmdEx(command)
      return output
    
    proc download(url, target: string): string {.discardable} =
      
      return runshell("wget -q -O- \"" & url & "\" > " & target)
    
    download("http://example.com/big.txt";, "/tmp/big.txt")
    
    
    Run

Reply via email to