#unix #unix-file #hierarchy #path #directory #virtual-filesystem #sandbox

pathio

Data type for storing generic data on a virtual path tree hierarchy. The data is stored in memory, this is not OS file system abstraction, but immitation

16 releases

0.2.3 Nov 17, 2023
0.2.2 Nov 15, 2023
0.1.6 Nov 4, 2023
0.1.5 Oct 1, 2023
0.0.5 Sep 21, 2023

#419 in Filesystem

Download history 19/week @ 2024-07-01 1/week @ 2024-07-08 14/week @ 2024-07-15 3/week @ 2024-07-22 9/week @ 2024-07-29 11/week @ 2024-08-05 3/week @ 2024-08-12 2/week @ 2024-08-19 15/week @ 2024-08-26 3/week @ 2024-09-02 6/week @ 2024-09-09 14/week @ 2024-09-16 33/week @ 2024-09-23 16/week @ 2024-09-30 8/week @ 2024-10-14

58 downloads per month
Used in 5 crates (2 directly)

MIT/Apache

45KB
835 lines

Pathio

Crate adding PathTree, a special type immitating UNIX file system for storing any generic type <T>.

=== Description ===

It is created by daisy chaining HashMaps. It splits data into directories, which can store <T> or nest subdirectories.

use pathio::prelude::*;

let mut tree: PathTree<String> = PathTree::new("FileSystem");

tree.create_directory("New_Folder").unwrap();
tree.create_directory("New_Folder/Strings").unwrap();
tree.create_directory("Cool_Folder").unwrap();

tree.insert_file("New_Folder/Strings/text.txt", "Hello World!".to_string()).unwrap();

println!("{}", tree.list());

Console output:

> FileSystem
  |-> Cool_Folder
  |-> New_Folder
  |    |-> Strings
  |    |    |-> text.txt

=== Contributing ===

Any contribution submitted by you will be dual licensed as mentioned below, without any additional terms or conditions.

=== Licensing ===

Released under both APACHE and MIT licenses, for the sake of compatibility with other projects. Pick one that suits you the most!

Dependencies

~1–16MB
~153K SLoC