You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be handy to be able to use Command::exec() with a convenient macro. I commonly use this when I need to transform the current process entirely into another process without creating a new subprocess. This can be particularly useful for creating wrappers around other programs or for use in certain types of daemon processes.
For example:
use std::os::unix::process::CommandExt;use std::process::Command;fnmain(){let error = Command::new("ls").arg("-l").arg("/home").exec();// Replaces the current process with `ls`eprintln!("Failed to execute ls: {}", error);}
The text was updated successfully, but these errors were encountered:
It would be handy to be able to use
Command::exec()
with a convenient macro. I commonly use this when I need to transform the current process entirely into another process without creating a new subprocess. This can be particularly useful for creating wrappers around other programs or for use in certain types of daemon processes.For example:
The text was updated successfully, but these errors were encountered: