diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..5b8c3dd --- /dev/null +++ b/clean.sh @@ -0,0 +1 @@ +rm -rf ./data ./graphs ./optimized \ No newline at end of file diff --git a/smem_auto_start.sh b/smem_auto_start.sh old mode 100644 new mode 100755 diff --git a/src/bin/auto_pmap.rs b/src/bin/auto_pmap.rs index fd92331..c54f82e 100644 --- a/src/bin/auto_pmap.rs +++ b/src/bin/auto_pmap.rs @@ -2,10 +2,11 @@ use std::process::{Command, Stdio}; use std::thread; use std::time::Duration; use std::path::Path; -use std::fs::OpenOptions; +use std::fs::{OpenOptions, create_dir_all}; use std::io::Write; fn main() { + let _ = create_dir_all("data"); loop { let output = Command::new("pmap") .args(["-x", "82768"]) diff --git a/src/bin/auto_ps.rs b/src/bin/auto_ps.rs index b081a90..70cb8c9 100644 --- a/src/bin/auto_ps.rs +++ b/src/bin/auto_ps.rs @@ -1,12 +1,12 @@ use std::process::{Command, Stdio}; -use std::fs::OpenOptions; +use std::fs::{OpenOptions, create_dir_all}; use std::io::Write; use std::thread; use std::time::Duration; use std::path::Path; - fn main() { + let _ = create_dir_all("data"); loop { let output = Command::new("ps") .args(["aux"]) diff --git a/src/bin/auto_smem.rs b/src/bin/auto_smem.rs index a6c3dd5..e5e0282 100644 --- a/src/bin/auto_smem.rs +++ b/src/bin/auto_smem.rs @@ -2,15 +2,16 @@ use std::process::{Command, Stdio}; use std::thread; use std::time::Duration; use std::path::Path; -use std::fs::OpenOptions; +use std::fs::{OpenOptions, create_dir_all}; use std::io::Write; fn main() { + let _ = create_dir_all("data"); loop { let output = Command::new("smem") .stdout(Stdio::piped()) .output() - .expect("Failed to execute command"); + .expect("Failed to execute command"); let output_str = String::from_utf8_lossy(&output.stdout); let lines = output_str.lines().skip(1); diff --git a/src/bin/csvcheck.rs b/src/bin/csvcheck.rs index b891d45..e57a257 100644 --- a/src/bin/csvcheck.rs +++ b/src/bin/csvcheck.rs @@ -7,10 +7,10 @@ use walkdir::WalkDir; fn main() -> io::Result<()> { let data_dir = "./data"; let optimized_dir = "./optimized"; - let graph_dir = "./graphs"; // グラフを保存するディレクトリ + let graph_dir = "./graphs"; fs::create_dir_all(optimized_dir)?; - fs::create_dir_all(graph_dir)?; // グラフ用ディレクトリの作成 + fs::create_dir_all(graph_dir)?; for entry in WalkDir::new(data_dir).into_iter().filter_map(|e| e.ok()) { let path = entry.path();