rapx 0.7.1

A static analysis platform for use-after-free, memory leakage detection, etc
1
2
3
4
5
6
7
8
9
10
11
use crate::utils::log::rap_error_and_exit;

use std::fs;
use std::path::Path;

pub fn rap_create_file<P: AsRef<Path>>(path: P, msg: impl AsRef<str>) -> fs::File {
    match fs::File::create(path) {
        Ok(file) => file,
        Err(e) => rap_error_and_exit(format!("{}: {}", msg.as_ref(), e)),
    }
}