#replace #process #another #posix #running #arg #execvp

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

#504 in Unix APIs

Download history 8486/week @ 2023-12-06 7463/week @ 2023-12-13 4644/week @ 2023-12-20 3135/week @ 2023-12-27 5888/week @ 2024-01-03 5734/week @ 2024-01-10 7505/week @ 2024-01-17 6422/week @ 2024-01-24 7569/week @ 2024-01-31 8163/week @ 2024-02-07 9678/week @ 2024-02-14 7037/week @ 2024-02-21 6974/week @ 2024-02-28 7634/week @ 2024-03-06 7115/week @ 2024-03-13 9113/week @ 2024-03-20

31,875 downloads per month
Used in 44 crates (38 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

~230KB