Last active
December 30, 2015 04:49
-
-
Save jbenner-radham/7778854 to your computer and use it in GitHub Desktop.
A simple and hacky program to trigger wdsutil... even though it doesn't actually do that yet. It's a learning & comparison project of Go vs. Rust (I'm rooting for Rust) so let's see how it goes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[link(name = "wdsutil_boot_prog", vers = "0.0.0")]; | |
fn main() { | |
use std::{io, os, run}; | |
let argv : ~[~str] = os::args(); | |
let argc : uint = argv.len(); | |
let stderr : @io::Writer = io::stderr(); | |
if argc < 4 { | |
//return stderr.write_line("Not enough arrrrrgs! We need the Device, ID and BootProgram."); | |
} | |
//let pargs : &[~str] = [~"127.0.0.1"]; | |
let pargs : &[~str] = [argv[1]]; | |
let pout : run::ProcessOutput = run::process_output("ping.exe", pargs); | |
let pout_str : &str = std::str::from_utf8_slice(pout.output); | |
println(fmt!("%s", pout_str)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment