# Lectura de información de procesos
```rust,no_run
# fn main() -> Result<(), Box<dyn std::error::Error>> {
use sinf::system::{Pid, System};
let sys = System::new_all()?;
let Some(process) = sys.process(Pid::from(1337)) else {
return Ok(());
};
println!("name: {:?}", process.name());
println!("exe: {:?}", process.exe());
println!("cmd: {:?}", process.cmd());
println!("usage: {}%", process.cpu_usage());
println!("disk: {:?}", process.disk_usage());
# Ok(())
# }
```
Para detener un proceso y esperar a que termine:
```rust,no_run
# fn main() -> Result<(), Box<dyn std::error::Error>> {
use sinf::system::{Pid, System};
let sys = System::new_all()?;
let Some(process) = sys.process(Pid::from(1337)) else {
return Ok(());
};
if process.kill() {
if let Some(status) = process.wait() {
println!("exited with {status:?}");
}
}
# Ok(())
# }
```
Los procesos se refrescan con `System::refresh_processes` o
`System::refresh_processes_specifics`. Algunos datos (usuario, entorno, cwd,
root, cmd) pueden refrescarse condicionalmente con `ProcessRefreshKind`.