| 274 | use std::collections::BTreeMap; |
| 275 | fn snapshot(root: &Path) -> BTreeMap<std::path::PathBuf, Vec<u8>> { |
| 276 | fn visit(path: &Path, files: &mut BTreeMap<std::path::PathBuf, Vec<u8>>) { |
| 277 | if path.is_dir() { |
| 278 | for entry in fs::read_dir(path).unwrap() { |
| 279 | visit(&entry.unwrap().path(), files); |
| 280 | } |
| 281 | } else if path.is_file() { |
| 282 | files.insert(path.to_path_buf(), fs::read(path).unwrap()); |
| 283 | } |
| 284 | } |
| 285 | let mut files = BTreeMap::new(); |
| 286 | for path in ["atomic.redb", "changes", "bridge", "deferred-tree-ops.json"] { |
| 287 | visit(&root.join(".atomic").join(path), &mut files); |