Skip to content

File walker with glob support #10

@DavidBM

Description

@DavidBM

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions