/// Returns the ELF class from the ELF header in the supplied file.
Returns the ELF class from the ELF header in the supplied file.
Returns the ELF class from the ELF header in the supplied file .
fn parse_elf_header(path: &Path) -> io::Result<u8> {
    let mut file = File::open(path)?;
    let mut buffer = [0; 5];
    file.read_exact(&mut buffer)?;
    if buffer[..4] == [127, 69, 76, 70] {
        Ok(buffer[4])
    } else {
        Err(Error::new(ErrorKind::InvalidData, "invalid ELF header"))
    }
}
fn parse_elf_header ( path : & Path ) -> io :: Result < u8 > { let mut file = File :: open ( path ) ? ; let mut buffer = [ 0 ; 5 ] ; file . read_exact ( & mut buffer ) ? ; if buffer [ .. 4 ] == [ 127 , 69 , 76 , 70 ] { Ok ( buffer [ 4 ] ) } else { Err ( Error :: new ( ErrorKind :: InvalidData , " " ) ) } }
Returns the ELF class from the ELF header in the supplied file.
Returns the ELF class from the ELF header in the supplied file .
path
&Path
<not_specific>