germangb / mini-fs Goto Github PK
View Code? Open in Web Editor NEWExtensible app filesystem library.
License: MIT License
Extensible app filesystem library.
License: MIT License
This is a suggestion.
As I stated in #1 (comment), the names were confusing me because it's not named with a filesystem perspective.
I suggest the following name changes:
I can make a PR after you give feedback.
How do you want shadowing to work?
It's clear that files should shadow other files with the same path, but what about dirs?
Right now with a tupple overlay a "/a" file with prevent the "/a" dir ("/a/a" file) of another store from appearing in the entries iterator of "/", but you can still open the "/a/a" file so it's actually a partial shadow.
(dir shadows the file if you reverse the order)
Personally, I would allow at most one file entry and one dir entry with the same name.
This would mean one "a" file entry and one "a" dir entry from the entries iterator in the example above.
The initial design of this crate seemed file-centric, so I think it fits too. :)
(dirs wouldn't be able to shadow files)
I tried to use this crate in a project but it was too limited for my case.
I wanted to use another file format so I tried to implement a Store
based on your Tar
and Zip
, but the File
constructors are public only inside your crate so I can't implement Store::open
.
I also needed my paths to be case-insensitive. I tried to implement a Store
that maps uppercase paths to case-sensitive paths, but there is no way to list the file paths inside a Store
so I can't implement it.
How can I see the mounted virtual file system directory in windows? I tried to mount the zip file with the local file system, but I couldn't see the mounted directory file in the windows file manager.
The version was bumped to 0.2 so I tried implementing a CaselessFs and found a problem with RamFs during my tests.
This code:
let mut ram = RamFs::new();
ram.touch("/a.txt", b"low a".to_vec());
ram.touch("/A.TXT", b"high a".to_vec());
ram.touch("/b/b.txt", b"low b".to_vec());
ram.touch("/B/B.TXT", b"high b".to_vec());
for entry in ram.entries("/").unwrap() {
println!("{:?}", &entry);
}
prints this:
Ok(Entry { name: "A.TXT", kind: File })
Ok(Entry { name: "a.txt", kind: File })
Ok(Entry { name: "B", kind: File })
Ok(Entry { name: "b", kind: File })
B
and b
are directories, not files.
Hey,
I'm involved in the IconPie project, and we are contemplating using your crate.
Unfortunately we would need to be able to write data, which is currently not implemented, unless I'm mistaken.
Could you consider adding write support to mini_fs
?
Cheers!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.