Spawn External Processes with Rust Standard Library 🦀 Rust Programming Tutorial for Developers

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

Комментарии • 7

  • @TrevorSullivan
    @TrevorSullivan  Год назад +1

    Please help support more videos by shopping on my Amazon storefront! 📦 www.amazon.com/shop/trevorsullivan

  • @mohaniya15
    @mohaniya15 Год назад

    Love your videos. I just started making Rust videos a while back, your videos really help.

  • @shreyaskarthik2185
    @shreyaskarthik2185 6 месяцев назад

    Clear and consice , thank you so much i learnt a lot

    • @TrevorSullivan
      @TrevorSullivan  6 месяцев назад +1

      I'm so happy to hear that! Thank you for letting me know. Keep on learning and practicing Rust!

  • @TechLord79
    @TechLord79 6 месяцев назад

    head reads lines and is waiting for input to end because "inputtwo" is not line-terminated -> "inputone
    inputtwo
    " should do

  • @coderswat
    @coderswat Год назад

    nice vid

  • @eqtraderagent9960
    @eqtraderagent9960 11 месяцев назад

    Outstanding! #DeskChecking
    cargo run
    Compiling life v0.1.0 (/home/alone/life)
    Finished dev [unoptimized + debuginfo] target(s) in 0.35s
    Running `/home/alone/life/target/debug/life`
    Was execution successful? true
    use std::process::Command;
    use std::process::Output;
    use std::error::Error;
    fn main() {
    let mut p1: Command = Command::new("which");
    p1.arg("python3");
    let proc_result: Result = p1.output().map_err(|e| e.into());
    if proc_result.is_ok() {
    let result: Output = proc_result.unwrap();
    println!("Was execution successful? {}", result.status.success());
    if !result.status.success() {
    println!("Error occurred: {}", result.status.code().unwrap());
    }
    }
    }