We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ab5bec2 + 9f91a4d commit 7ef2b7bCopy full SHA for 7ef2b7b
src/libstd/sys/redox/os.rs
@@ -179,7 +179,7 @@ pub fn getenv(key: &OsStr) -> io::Result<Option<OsString>> {
179
180
pub fn setenv(key: &OsStr, value: &OsStr) -> io::Result<()> {
181
if ! key.is_empty() {
182
- let mut file = ::fs::File::open(&("env:".to_owned() + key.to_str().unwrap()))?;
+ let mut file = ::fs::File::create(&("env:".to_owned() + key.to_str().unwrap()))?;
183
file.write_all(value.as_bytes())?;
184
file.set_len(value.len() as u64)?;
185
}
0 commit comments