#posix #process #replace

exec

Use the POSIX exec function to replace the running program with another

5 unstable releases

Uses old Rust 2015

0.3.1 Sep 22, 2017
0.3.0 Jul 13, 2017
0.2.0 Mar 26, 2016
0.1.1 Mar 25, 2016
0.1.0 Mar 25, 2016

#117 in Unix APIs

Download history 4935/week @ 2022-10-12 3663/week @ 2022-10-19 4167/week @ 2022-10-26 4325/week @ 2022-11-02 4252/week @ 2022-11-09 4687/week @ 2022-11-16 4197/week @ 2022-11-23 3880/week @ 2022-11-30 5232/week @ 2022-12-07 4554/week @ 2022-12-14 3062/week @ 2022-12-21 2823/week @ 2022-12-28 4093/week @ 2023-01-04 5117/week @ 2023-01-11 4247/week @ 2023-01-18 3681/week @ 2023-01-25

17,693 downloads per month
Used in 38 crates (32 directly)

MIT/Apache

9KB
97 lines

exec: A Rust library to replace the running program with another

Latest version License Build Status

Documentation

This is a simple Rust wrapper around execvp. It can be used as follows:

let err = exec::Command::new("echo")
    .arg("hello").arg("world")
    .exec();
println!("Error: {}", err);

Note that if exec returns, it will always return an error. There's also a lower-level exec::execvp function if you need to use it.


lib.rs:

A simple wrapper around the C library's execvp function.

For examples, see the repository.

We'd love to fully integrate this with std::process::Command, but that module doesn't export sufficient hooks to allow us to add a new way to execute a program.

Dependencies

~71KB