Remove write_file from FAT.

This commit is contained in:
Bas Wiel, van de 2024-05-02 17:41:01 +02:00
parent 2d13ecce28
commit 3009149ae9
1 changed files with 0 additions and 39 deletions

View File

@ -551,45 +551,6 @@ impl Fat {
Ok(())
}
pub fn write_file(
&mut self,
file: &[u8],
filename: &str,
directory: Option<DirEntry>,
entry_type: Option<DirEntryType>,
partition: &Partition,
disk: &mut Disk,
) -> Result<(), std::io::Error> {
let allocated_clusters: Vec<u32> = self.allocate_clusters(file)?;
let bytes_per_cluster = self.sectors_per_cluster as usize * 512;
let mut remaining_data = file;
// Create a directory entry for the new file
let dir_entry = match entry_type {
None => DirEntry::new(
filename,
DirEntryType::File,
None,
&allocated_clusters,
file.len() as u32,
Some(file),
)?,
Some(entry_type) => DirEntry::new(
filename,
entry_type,
None,
&allocated_clusters,
file.len() as u32,
Some(file),
)?,
};
if directory.is_none() {
self.root_directory.add_child(dir_entry);
}
Ok(())
}
/// Generate a BIOS Parameter Block (BPB) compatible with DOS 2.00.
///
/// Constructs a BPB suitable for DOS 2.00 based on the filesystem parameters.