forked from M-Labs/zynq-rs
config: create config dir if not present
This commit is contained in:
parent
1c8e2c318c
commit
f496da4f3e
@ -164,7 +164,8 @@ impl Config {
|
|||||||
f.seek(SeekFrom::End(0))?;
|
f.seek(SeekFrom::End(0))?;
|
||||||
write!(f, "{}={}\n", key, String::from_utf8(value).unwrap())?;
|
write!(f, "{}={}\n", key, String::from_utf8(value).unwrap())?;
|
||||||
} else {
|
} else {
|
||||||
let mut f = root_dir.create_file(&["/CONFIG/", key, ".BIN"].concat())?;
|
let mut dir = root_dir.create_dir("/CONFIG")?;
|
||||||
|
let mut f = dir.create_file(&[key, ".BIN"].concat())?;
|
||||||
f.write_all(&value)?;
|
f.write_all(&value)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user