forked from Rativel/BurritOS
open_file impl
This commit is contained in:
@@ -20,6 +20,18 @@ pub struct FileHdr {
|
||||
|
||||
impl FileHdr {
|
||||
|
||||
//Juste histoire d'avoir un constructeur, temporaire
|
||||
pub fn new() -> FileHdr {
|
||||
FileHdr{
|
||||
is_dir : 0,
|
||||
num_bytes : 0,
|
||||
num_sectors : 0,
|
||||
data_sectors : Vec::new(),
|
||||
num_header_sectors : 0,
|
||||
header_sectors : [0 ; MAX_HEADER_SECTORS as usize]
|
||||
}
|
||||
}
|
||||
|
||||
pub fn allocate(&mut self, mut free_map: BitMap, file_size: i32) -> bool {
|
||||
self.num_bytes = file_size;
|
||||
if file_size > MAX_FILE_LENGTH {
|
||||
|
||||
Reference in New Issue
Block a user