Crates.io | tree-mapper |
lib.rs | tree-mapper |
version | 0.1.0 |
source | src |
created_at | 2024-08-30 19:13:49.522981 |
updated_at | 2024-08-30 19:13:49.522981 |
description | A utility for generating a hierarchical mapping of files and directories represented as a HashMap. The mapping reflects the directory structure and file levels, allowing for efficient retrieval and analysis of file system organization. |
homepage | |
repository | https://github.com/j-p-d-e-v/tree-mapper.git |
max_upload_size | |
id | 1358060 |
size | 17,531 |
This utility generates a hierarchical mapping of files and directories, represented as a HashMap
. It reflects the structure of directories and files based on their levels, providing a clear view of the organization of the file system.
cargo add tree-mapper
use std::collections::HashMap;
use std::path::Path;
use tree_mapper::explore;
use tree_mapper::TreeType;
let base_path: String = String::from("storage/test-data");
let mut data: HashMap<String,Vec<TreeType>> = HashMap::new();
explore(Path::new(&base_path),&mut data,1);
let mapping: String = to_json(data);
println!("{}",mapping);
Feel free to open issues or submit pull requests for enhancements and bug fixes.
This project is licensed under the MIT License.