Basically, unzip accepts king of globs patterns. I think we should go fully glob as they are libs for that. The problem here is that there is no walker with glob that support non-utf8 file paths.
You can look at this conversation: rust-lang/glob#59 (EDIT: I had mess up the link)
There is a problem here, and basically is in the nature of globs.
If we have, for example, this command
unzip ./test/test1/**/*.zip /home/user1/Downloads/linux-*.zip
We will need to list all files that match these 2 folders. That can be a very expensive operation. As I see it, it should be something like this:
- The the "starting" folder for each glob
./test/test1/ for the first, /home/user1/Downloads/ for the second
- Without this it can be a very costly to find the zip files as we would need to search from /
- From these 2 directories, search in parallel every file and match it against the glob.
Maybe we can merge globs like /home/user1/Downloads/ and ./Downloads in order to avoid to walk the same folder 2 times.
In any case, this is not trivial and the libraries that are there are not as good as I would like.
After some research I think the best approach is to use globset + walkdir for now and eventually use whatever comes from the github nursery link I shared before.
Basically, unzip accepts king of globs patterns. I think we should go fully glob as they are libs for that. The problem here is that there is no walker with glob that support non-utf8 file paths.
You can look at this conversation: rust-lang/glob#59 (EDIT: I had mess up the link)
There is a problem here, and basically is in the nature of globs.
If we have, for example, this command
unzip ./test/test1/**/*.zip /home/user1/Downloads/linux-*.zipWe will need to list all files that match these 2 folders. That can be a very expensive operation. As I see it, it should be something like this:
./test/test1/for the first,/home/user1/Downloads/for the secondMaybe we can merge globs like
/home/user1/Downloads/and./Downloadsin order to avoid to walk the same folder 2 times.In any case, this is not trivial and the libraries that are there are not as good as I would like.
After some research I think the best approach is to use globset + walkdir for now and eventually use whatever comes from the github nursery link I shared before.