Skip to content

Commit

Permalink
Add get_path for processes. (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinjul1704 authored Jan 17, 2025
1 parent 8a9430c commit df50220
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/process/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,18 @@ impl Process
/// let attached = process.is_attached();
/// ```
pub fn is_attached(&self) -> bool {return self.process_data.borrow().attached;}
}

/// Returns file path of the processes' executable
///
/// # Examples
///
/// ```
/// use mem_rs::prelude::*;
///
/// let mut process = Process::new("name_of_process.exe");
/// process.refresh().unwrap();
///
/// println!("{}", process.get_path());
/// ```
pub fn get_path(&self) -> String {return self.process_data.borrow().path.clone();}
}

0 comments on commit df50220

Please sign in to comment.