• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H03-May-2022-8171

src/H03-May-2022-6,0404,200

tests/H03-May-2022-516339

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D01-Jan-197074 65

COPYINGH A D29-Nov-1973126 42

Cargo.lockH A D01-Jan-19704.7 KiB188166

Cargo.tomlH A D01-Jan-19701.6 KiB6250

Cargo.toml.orig-cargoH A D29-Nov-1973960 4034

LICENSE-MITH A D29-Nov-19731.1 KiB2217

README.mdH A D29-Nov-19731.6 KiB6042

UNLICENSEH A D29-Nov-19731.2 KiB2520

README.md

1ignore
2======
3The ignore crate provides a fast recursive directory iterator that respects
4various filters such as globs, file types and `.gitignore` files. This crate
5also provides lower level direct access to gitignore and file type matchers.
6
7[![Build status](https://github.com/BurntSushi/ripgrep/workflows/ci/badge.svg)](https://github.com/BurntSushi/ripgrep/actions)
8[![](https://img.shields.io/crates/v/ignore.svg)](https://crates.io/crates/ignore)
9
10Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).
11
12### Documentation
13
14[https://docs.rs/ignore](https://docs.rs/ignore)
15
16### Usage
17
18Add this to your `Cargo.toml`:
19
20```toml
21[dependencies]
22ignore = "0.4"
23```
24
25### Example
26
27This example shows the most basic usage of this crate. This code will
28recursively traverse the current directory while automatically filtering out
29files and directories according to ignore globs found in files like
30`.ignore` and `.gitignore`:
31
32
33```rust,no_run
34use ignore::Walk;
35
36for result in Walk::new("./") {
37    // Each item yielded by the iterator is either a directory entry or an
38    // error, so either print the path or the error.
39    match result {
40        Ok(entry) => println!("{}", entry.path().display()),
41        Err(err) => println!("ERROR: {}", err),
42    }
43}
44```
45
46### Example: advanced
47
48By default, the recursive directory iterator will ignore hidden files and
49directories. This can be disabled by building the iterator with `WalkBuilder`:
50
51```rust,no_run
52use ignore::WalkBuilder;
53
54for result in WalkBuilder::new("./").hidden(false).build() {
55    println!("{:?}", result);
56}
57```
58
59See the documentation for `WalkBuilder` for many other options.
60