use std::fs::File; use std::io::{Read, Seek, SeekFrom}; use std::path::{Path, PathBuf}; use byteorder::*; pub fn apply_ips(ips_file: PathBuf, binary: PathBuf) { match ips_file.exists() || binary.exists() { true => { let mut ips = File::open(ips_file).unwrap(); let mut bin = File::open(binary).unwrap(); let mut ips_str = String::new(); let mut bin_str = String::new(); ips.read_to_string(&mut ips_str).unwrap(); bin.read_to_string(&mut bin_str).unwrap(); ips.seek(SeekFrom::Start(5)).unwrap(); println!("{:?}", ips.read_f32::().unwrap()); }, false => panic!("\u{1F926}"), } }