#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

#707 in Unix APIs

Download history 33119/week @ 2026-04-16 32379/week @ 2026-04-23 27464/week @ 2026-04-30 26642/week @ 2026-05-07 33983/week @ 2026-05-14 30778/week @ 2026-05-21 30529/week @ 2026-05-28 19769/week @ 2026-06-04 30710/week @ 2026-06-11 25432/week @ 2026-06-18 20472/week @ 2026-06-25 23990/week @ 2026-07-02 24793/week @ 2026-07-09 25675/week @ 2026-07-16 29344/week @ 2026-07-23 29193/week @ 2026-07-30

114,188 downloads per month
Used in 56 crates (46 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

~235KB