pub fn write(&mut self, filesystem: &mut FileSystem, data: Vec<il::Expression>) -> Result<()> {
        let file_bytes = filesystem
            .file_bytes_mut(&self.path)
            .ok_or(format!("Failed to get bytes for fd {}", self.fd))?;

        let data_len = data.len();

        data.into_iter().enumerate().for_each(|(i, byte)| {
            if self.offset + i >= file_bytes.len() {
                file_bytes.push(byte);
            } else {
                *file_bytes.get_mut(self.offset + i).unwrap() = byte;
            }
        });

        self.offset += data_len;

        Ok(())
    }
/// Write the given number of bytes to this `FileDescriptor`.
///
/// Updates the internal offset.
Write the given number of bytes to this `FileDescriptor`.
Updates the internal offset.
Write the given number of bytes to this ` FileDescriptor ` . Updates the internal offset .
pub fn write(&mut self, filesystem: &mut FileSystem, data: Vec<il::Expression>) -> Result<()> {
        let file_bytes = filesystem
            .file_bytes_mut(&self.path)
            .ok_or(format!("Failed to get bytes for fd {}", self.fd))?;
        let data_len = data.len();
        data.into_iter().enumerate().for_each(|(i, byte)| {
            if self.offset + i >= file_bytes.len() {
                file_bytes.push(byte);
            } else {
                *file_bytes.get_mut(self.offset + i).unwrap() = byte;
            }
        });
        self.offset += data_len;
        Ok(())
    }
pub fn write ( & mut self , filesystem : & mut FileSystem , data : Vec < il :: Expression > ) -> Result < ( ) > { let file_bytes = filesystem . file_bytes_mut ( & self . path ) . ok_or ( format ! ( " " self fd ) ) ? ; let data_len = data . len ( ) ; data . into_iter ( ) . enumerate ( ) . for_each ( | ( i , byte ) | { if self . offset + i >= file_bytes . len ( ) { file_bytes . push ( byte ) ; } else { * file_bytes . get_mut ( self . offset + i ) . unwrap ( ) = byte ; } } ) ; self . offset += data_len ; Ok ( ( ) ) }
Write the given number of bytes to this `FileDescriptor`.
Write the given number of bytes to this ` FileDescriptor ` .
&mut self
filesystem
&mut FileSystem
data
Vec<il::Expression>