We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18bf054 commit de68aceCopy full SHA for de68ace
src/libstd/sys/redox/os.rs
@@ -113,8 +113,18 @@ impl StdError for JoinPathsError {
113
}
114
115
pub fn current_exe() -> io::Result<PathBuf> {
116
- use io::ErrorKind;
117
- Err(io::Error::new(ErrorKind::Other, "Not yet implemented on redox"))
+ use fs::File;
+
118
+ let mut file = File::open("sys:exe")?;
119
120
+ let mut path = String::new();
121
+ file.read_to_string(&mut path)?;
122
123
+ if path.ends_with('\n') {
124
+ path.pop();
125
+ }
126
127
+ Ok(PathBuf::from(path))
128
129
130
pub struct Env {
0 commit comments