Skip to content

Commit df50220

Browse files
authored
Add get_path for processes. (#5)
1 parent 8a9430c commit df50220

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/process/mod.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,18 @@ impl Process
9797
/// let attached = process.is_attached();
9898
/// ```
9999
pub fn is_attached(&self) -> bool {return self.process_data.borrow().attached;}
100-
}
101100

101+
/// Returns file path of the processes' executable
102+
///
103+
/// # Examples
104+
///
105+
/// ```
106+
/// use mem_rs::prelude::*;
107+
///
108+
/// let mut process = Process::new("name_of_process.exe");
109+
/// process.refresh().unwrap();
110+
///
111+
/// println!("{}", process.get_path());
112+
/// ```
113+
pub fn get_path(&self) -> String {return self.process_data.borrow().path.clone();}
114+
}

0 commit comments

Comments
 (0)