rust-fd-0.1.0 is not a library.
rust-fd
A fast file finder written in Rust, inspired by fd.
Features
- 🚀 Fast: Iterative directory traversal with no stack overflow on deep directories
- 🔍 Pattern Matching: Glob pattern support (
*.rs,file*, etc.) - 📁 Comprehensive: Finds files, directories, and symlinks
- 🎯 Simple: Easy-to-use command-line interface
- ✅ Tested: Handles edge cases (spaces in names, deep nesting, symlinks)
Installation
From Source
The binary will be at target/release/rust-fd.
From Crates.io (Coming Soon)
Usage
Basic Examples
# Find all files and directories
# Find all Rust files
# Find all files starting with "test"
# Find files containing "config"
Pattern Syntax
rust-fd uses glob patterns for matching:
*- Matches any sequence of characters?- Matches any single character[abc]- Matches any character in the set[!abc]- Matches any character not in the set
Note: Patterns are case-sensitive.
Examples
# Find all JavaScript and TypeScript files
# Find all test files
# Find README files
# Find all files (no pattern)
Performance
rust-fd uses an iterative approach with an explicit stack for directory traversal, which:
- ✅ Prevents stack overflow on deeply nested directories
- ✅ Handles hundreds of thousands of files efficiently
- ✅ Uses constant call stack space
Tested on:
- ✅ 100-level deep directory nesting
- ✅ 500,000+ files without issues
Development
Running Tests
# Run the automated test suite
# Or run with cargo
Project Structure
rust-fd/
├── src/
│ └── main.rs # Main implementation
├── test_cases/ # Test files and directories
├── test_pattern_matching.sh # Test script
├── Cargo.toml
└── README.md
Roadmap
- Iterative directory traversal
- Glob pattern matching
- Filter by file type (file/dir/symlink)
- CLI argument parsing with clap
- Ignore .gitignore patterns
- Parallel directory traversal
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
MIT License - see LICENSE for details.
Acknowledgments
Inspired by fd - a fast alternative to find.