Giter Club home page Giter Club logo

Comments (5)

Dr-Emann avatar Dr-Emann commented on July 17, 2024

This would be really easy to do, where we say:

let walker = WalkDir::new(&self.path)
            .into_iter()
            ....
            .enumerate();

We just have to add a line saying:

let walker = WalkDir::new(&self.path)
            .into_iter()
            .filter_entry(|e| excludes.is_match(e.path()))
            ....
            .enumerate();

The only downside is that the number and size of excluded files will be inaccurate.

from compactor.

Freaky avatar Freaky commented on July 17, 2024

I'd probably keep scanning excluded files in order to minimise the inaccuracy. Not much point skipping them - it doesn't make the directory scan much cheaper, just saves checking the compressed size.

It's notable that currently compressed files do not get checked against the excludes list - they go into the compressed pile, so you can still decompress them.

from compactor.

agret avatar agret commented on July 17, 2024

I'd probably keep scanning excluded files in order to minimise the inaccuracy. Not much point skipping them - it doesn't make the directory scan much cheaper, just saves checking the compressed size.

If you are excluding the Windows folder for example it has many many subfolders with many files in each of those. Seems like a total waste of time to be crawling that when it's on the excluded list. There are many other cases where you might have a directory tree with tons of sub files that you don't want to waste time processing also.

from compactor.

Freaky avatar Freaky commented on July 17, 2024

To be clear, if you've excluded a folder, it and all its contents are skipped entirely. If you've excluded a pattern of files inside a folder, like, say C:\bla\*.log, matching files will still have their compressed file size checked like any other file so it'll still give you an accurate assessment of the size of the folder.

I really should publish a new release with this in, shouldn't I :)

from compactor.

Freaky avatar Freaky commented on July 17, 2024

Excluded subdirectories now pruned entirely in v0.8.0.

from compactor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.