#replace #running #posix #execute #arguments

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

#640 in Unix APIs

Download history 28956/week @ 2025-11-23 34612/week @ 2025-11-30 31058/week @ 2025-12-07 30902/week @ 2025-12-14 17104/week @ 2025-12-21 12142/week @ 2025-12-28 27846/week @ 2026-01-04 25095/week @ 2026-01-11 15043/week @ 2026-01-18 20039/week @ 2026-01-25 20032/week @ 2026-02-01 23308/week @ 2026-02-08 30276/week @ 2026-02-15 25498/week @ 2026-02-22 30625/week @ 2026-03-01 33928/week @ 2026-03-08

123,933 downloads per month
Used in 54 crates (42 directly)

MIT/Apache

9KB
97 lines

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.


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.

Dependencies

~230KB