libconfig: add long filename support to fatfs #96

Merged
sb10q merged 2 commits from mwojcik/zynq-rs:config_fat_lfn into master 2022-04-07 17:40:24 +08:00
2 changed files with 3 additions and 1 deletions

View File

@ -16,3 +16,4 @@ target_coraz7 = []
target_redpitaya = []
target_kasli_soc = []
ipv6 = []
fat_lfn = [ "fatfs/alloc" ]

View File

@ -164,7 +164,8 @@ impl Config {
f.seek(SeekFrom::End(0))?;
write!(f, "{}={}\n", key, String::from_utf8(value).unwrap())?;
} else {
let mut f = root_dir.create_file(&["/CONFIG/", key, ".BIN"].concat())?;
let dir = root_dir.create_dir("/CONFIG")?;
let mut f = dir.create_file(&[key, ".BIN"].concat())?;
f.write_all(&value)?;
}
}