| Crates.io | libc-system |
| lib.rs | libc-system |
| version | 0.1.2 |
| created_at | 2025-04-11 08:05:01.215921+00 |
| updated_at | 2025-04-11 09:59:35.750442+00 |
| description | Single cross‑platform function, system, to execute a shell command and return its exit code |
| homepage | https://github.com/cecton/libc-system |
| repository | https://github.com/cecton/libc-system |
| max_upload_size | |
| id | 1629459 |
| size | 17,911 |
libc-system provides a single cross‑platform function, [system], to execute a shell
command and return its exit code.
system() function. The command is
passed as a narrow (UTF‑8) null‑terminated C string._wsystem() function. The command is converted from
UTF‑8 to a wide (UTF‑16) string to properly handle non‑ASCII characters.This crate lets you execute shell commands without having to worry about platform-specific differences.
use libc_system::system;
let exit_code = system("echo Hello, World!");
println!("Exit code: {}", exit_code);
_wsystem from the C runtime. The command is converted into a wide
(UTF‑16) string.system from libc. The command is converted into a narrow, null‑terminated
string.