forked from M-Labs/rust-fatfs
Fix false comment that crate does not support volume label in root dir
This commit is contained in:
parent
9b4c3548dc
commit
35ebf03405
@ -366,8 +366,8 @@ impl<T: ReadWriteSeek> FileSystem<T> {
|
||||
/// Returns a volume label from BPB in the Boot Sector as `String`.
|
||||
///
|
||||
/// Non-ASCII characters are replaced by the replacement character (U+FFFD).
|
||||
/// Note: File with `VOLUME_ID` attribute in root directory is ignored by this library.
|
||||
/// Only label from BPB is used.
|
||||
/// Note: This function returns label stored in the BPB structure. Use `read_volume_label_from_root_dir` to read
|
||||
/// label from the root directory.
|
||||
#[cfg(feature = "alloc")]
|
||||
pub fn volume_label(&self) -> String {
|
||||
// Decode volume label from OEM codepage
|
||||
@ -380,8 +380,8 @@ impl<T: ReadWriteSeek> FileSystem<T> {
|
||||
/// Returns a volume label from BPB in the Boot Sector as byte array slice.
|
||||
///
|
||||
/// Label is encoded in the OEM codepage.
|
||||
/// Note: File with `VOLUME_ID` attribute in root directory is ignored by this library.
|
||||
/// Only label from BPB is used.
|
||||
/// Note: This function returns label stored in the BPB structure. Use `read_volume_label_from_root_dir_as_bytes`
|
||||
/// to read label from the root directory.
|
||||
pub fn volume_label_as_bytes(&self) -> &[u8] {
|
||||
const PADDING: u8 = 0x20;
|
||||
let full_label_slice = &self.bpb.volume_label;
|
||||
|
Loading…
Reference in New Issue
Block a user