forked from M-Labs/rust-fatfs
Ignore LFN and fix handling of extension in filename.
Fixes fat12 and fat16 tests. Fat32 still doesnt work.
This commit is contained in:
parent
8df86d24ef
commit
c65d26bd2b
@ -50,7 +50,9 @@ fn convert_date_time(dos_date: u16, dos_time: u16) -> DateTime<Local> {
|
|||||||
impl FatDirEntry {
|
impl FatDirEntry {
|
||||||
|
|
||||||
pub fn get_name(&self) -> String {
|
pub fn get_name(&self) -> String {
|
||||||
str::from_utf8(&self.name).unwrap().trim_right().to_string()
|
let name = str::from_utf8(&self.name[0..8]).unwrap().trim_right();
|
||||||
|
let ext = str::from_utf8(&self.name[8..11]).unwrap().trim_right();
|
||||||
|
if ext == "" { name.to_string() } else { format!("{}.{}", name, ext) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_attrs(&self) -> FatFileAttributes {
|
pub fn get_attrs(&self) -> FatFileAttributes {
|
||||||
@ -103,6 +105,9 @@ impl FatDir {
|
|||||||
if entry.name[0] == 0xE5 {
|
if entry.name[0] == 0xE5 {
|
||||||
continue; // deleted
|
continue; // deleted
|
||||||
}
|
}
|
||||||
|
if entry.attrs == FatFileAttributes::LFN {
|
||||||
|
continue; // FIXME: support LFN
|
||||||
|
}
|
||||||
entries.push(entry);
|
entries.push(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user