check_file

Function check_file 

Source
pub fn check_file<P: AsRef<Path>>(filename: P) -> bool
Expand description

Check a file to see if it looks like an arxml file

Reads the beginning of the given file and checks if the data starts with a valid arxml header. If a header is found it immediately returns true and does not check any further data

The function returns false if the file cannot be read or if the data does not start with an arxml header

§Parameters

  • filename: name of the file to check

§Example

if autosar_data::check_file(filename) {
    // it looks like an arxml file
}