Giter VIP home page Giter VIP logo

find_file's Introduction

find_file

A simple tool to search files&folders in give directory

Usage

println!("{:?}", Search::dir("/Path/to/directory").with_depth(3).for_folder("src"));
println!("{:?}", Search::dir("/Path/to/directory").with_depth(3).for_file("src/lib.rs"));
println!("{:?}", Search::dir("/Path/to/directory").with_depth(3).for_both("src/lib.rs"));
// Search current working dir
println!("{:?}", Search::cwd(0).for_file("src/lib.rs"));
// Search parent dir of cwd
println!("{:?}", Search::cwd(1).with_depth(2).for_file("src/lib.rs"));

Note

  1. Search depth defaults to 1.
  2. If search path like "src/lib.rs", depth determines the first dir in the path, i.e "src".
  3. Search may fail with NotFound error in such conditions:
//$ tree directory 
///directory
//├── subdir1
//│   └── name1
//│       └── name2-diff
//└── subdir2
//    └── name1
//        └── name2
println!("{:?}", Search::dir(directory).with_depth(2).for_both("name1/name2"));

find_file's People

Contributors

kazec avatar

Watchers

 avatar

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.