Commit 945cbf90 by Enkelmann Committed by Enkelmann

Add fallback tmp-folder location

parent 67440d78
...@@ -179,9 +179,11 @@ fn get_project_from_ghidra(file_path: &Path) -> Project { ...@@ -179,9 +179,11 @@ fn get_project_from_ghidra(file_path: &Path) -> Project {
// Find the correct paths for temporary files. // Find the correct paths for temporary files.
let project_dirs = directories::ProjectDirs::from("", "", "cwe_checker") let project_dirs = directories::ProjectDirs::from("", "", "cwe_checker")
.expect("Could not determine path for temporary files"); .expect("Could not determine path for temporary files");
let tmp_folder = project_dirs let tmp_folder = if let Some(folder) = project_dirs.runtime_dir() {
.runtime_dir() folder
.expect("Could not determine path for temporary files"); } else {
Path::new("/tmp/cwe_checker")
};
if !tmp_folder.exists() { if !tmp_folder.exists() {
std::fs::create_dir(tmp_folder).expect("Unable to create temporary folder"); std::fs::create_dir(tmp_folder).expect("Unable to create temporary folder");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment