forked from M-Labs/rust-fatfs
Remove exfat references.
exfat is very different from fat12/16/32 and wont be supported.
This commit is contained in:
parent
f9f192c35e
commit
94dfe7ffd5
@ -16,7 +16,7 @@ use table::FatTable;
|
|||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||||
pub enum FatType {
|
pub enum FatType {
|
||||||
Fat12, Fat16, Fat32, ExFat
|
Fat12, Fat16, Fat32,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ReadSeek: Read + Seek {}
|
pub trait ReadSeek: Read + Seek {}
|
||||||
@ -114,7 +114,7 @@ impl <'a> FatFileSystem<'a> {
|
|||||||
pub fn new<T: ReadSeek>(mut rdr: &'a mut T) -> io::Result<FatFileSystem<'a>> {
|
pub fn new<T: ReadSeek>(mut rdr: &'a mut T) -> io::Result<FatFileSystem<'a>> {
|
||||||
let boot = Self::read_boot_record(&mut *rdr)?;
|
let boot = Self::read_boot_record(&mut *rdr)?;
|
||||||
if boot.boot_sig != [0x55, 0xAA] {
|
if boot.boot_sig != [0x55, 0xAA] {
|
||||||
return Err(Error::new(ErrorKind::Other, "invBox::newalid signature"));
|
return Err(Error::new(ErrorKind::Other, "invalid signature"));
|
||||||
}
|
}
|
||||||
|
|
||||||
let total_sectors = if boot.bpb.total_sectors_16 == 0 { boot.bpb.total_sectors_32 } else { boot.bpb.total_sectors_16 as u32 };
|
let total_sectors = if boot.bpb.total_sectors_16 == 0 { boot.bpb.total_sectors_32 } else { boot.bpb.total_sectors_16 as u32 };
|
||||||
@ -213,10 +213,8 @@ impl <'a> FatFileSystem<'a> {
|
|||||||
FatType::Fat12
|
FatType::Fat12
|
||||||
} else if total_clusters < 65525 {
|
} else if total_clusters < 65525 {
|
||||||
FatType::Fat16
|
FatType::Fat16
|
||||||
} else if total_clusters < 268435445 {
|
|
||||||
FatType::Fat32
|
|
||||||
} else {
|
} else {
|
||||||
FatType::ExFat
|
FatType::Fat32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ impl FatTable {
|
|||||||
FatType::Fat12 => FatTable::Fat12(FatTable12::from_read(rdr, size)?),
|
FatType::Fat12 => FatTable::Fat12(FatTable12::from_read(rdr, size)?),
|
||||||
FatType::Fat16 => FatTable::Fat16(FatTable16::from_read(rdr, size)?),
|
FatType::Fat16 => FatTable::Fat16(FatTable16::from_read(rdr, size)?),
|
||||||
FatType::Fat32 => FatTable::Fat32(FatTable32::from_read(rdr, size)?),
|
FatType::Fat32 => FatTable::Fat32(FatTable32::from_read(rdr, size)?),
|
||||||
_ => panic!("TODO: exfat")
|
|
||||||
};
|
};
|
||||||
Ok(table)
|
Ok(table)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user