use std::fs;
use std::path::Path;
use zccache::fingerprint::ScannedFile;
pub fn create_file(dir: &Path, rel: &str, content: &str) {
let path = dir.join(rel);
if let Some(parent) = path.parent() {
fs::create_dir_all(parent).unwrap();
}
fs::write(&path, content).unwrap();
}
#[allow(dead_code)]
pub fn rel_paths(files: &[ScannedFile]) -> Vec<&str> {
files.iter().map(|f| f.relative.as_str()).collect()
}
#[allow(dead_code)]
pub fn wait_for_mtime_change() {
std::thread::sleep(std::time::Duration::from_millis(1100));
}