#replace #posix #process #running #another #execute #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

#357 in Operating systems

Download history 14156/week @ 2024-10-04 12485/week @ 2024-10-11 10131/week @ 2024-10-18 12157/week @ 2024-10-25 10546/week @ 2024-11-01 9843/week @ 2024-11-08 10530/week @ 2024-11-15 9481/week @ 2024-11-22 8080/week @ 2024-11-29 10091/week @ 2024-12-06 11172/week @ 2024-12-13 4444/week @ 2024-12-20 3667/week @ 2024-12-27 7359/week @ 2025-01-03 9693/week @ 2025-01-10 6945/week @ 2025-01-17

28,036 downloads per month
Used in 46 crates (40 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