opendal
opendal copied to clipboard
Operator::lister_with should have an option to return itself if it's already a file path
Currently
pub fn lister_with(&self, path: &str) -> FutureList<impl Future<Output = Result<Lister>>>
will list the files inside the path. But if the path is already a file, we also need to return itself.
So maybe we could have an option, eg:
pub fn with_self(self, v: bool) -> Self {
self.map(|args| args.with_self(v))
}
Which could also return the existing path if it's set true.
I don't think we should add a new option for this. Maybe we should let services return the path itself if it exists.
For example:
a/
a/b
a/bb
a/c
list("a/")->a/b,a/bb,a/clist("a/b")->a/b,a/bb
We are returning the dir path itself now.