______ __
| _ \ | |.-----.-----.-----.-----.-----.-----.----.
|. | \| ||__ --| _ | -__| |__ --| -__| _|
|. | |__||_____| __|_____|__|__|_____|_____|__|
|: 1 / |__|
|::.. . /
`------'
An advance all in one file and folder
management tool.
Dispenser is a powerful command-line tool written in Rust that provides advanced file and folder management capabilities. It allows you to retrieve detailed metadata, calculate checksums, and organize files efficiently with various sorting options.
-
Metadata Retrieval: Get comprehensive information about files and directories
- Name, type, size, location
- Creation, modification, and access timestamps
- File permissions (read, write, execute)
- Recursive directory traversal with configurable depth
-
Checksum Calculation: Compute SHA-256 checksums for file integrity verification
-
Smart File Sorting: Organize files automatically based on:
- File extension (
se) - Date created (
sdc) - Date modified (
sdm) - Date accessed (
sda)
- File extension (
-
High Performance: Built with Rust for speed and reliability
-
Flexible Input: Process multiple files and directories in a single command
- Rust 1.70 or higher
- Cargo (comes with Rust)
# Clone the repository
git clone https://github.com/param-jasani/dispenser.git
cd dispenser
# Build the project
cargo build --release
# The binary will be available at target/release/dispensercargo install --path .dispenser [OPTIONS] --paths <PATHS>...| Flag | Long Form | Description | Default |
|---|---|---|---|
-p |
--paths <PATHS> |
Path(s) to file or directory (comma-separated) | Required |
-s |
--sort <METHOD> |
Sort files by method | sn (no sort) |
-m |
--metadata |
Retrieve metadata of the given path(s) | false |
-d |
--depth <DEPTH> |
Depth level to traverse for directories | 0 |
--checksum |
Calculate SHA-256 checksum of files | false |
sn- No sorting (default)se- Sort by extensionsdc- Sort by date createdsdm- Sort by date modifiedsda- Sort by date accessed
dispenser -p ./myfile.txt -mdispenser -p ./myfolder -m -d 2This will traverse the directory up to 2 levels deep.
dispenser -p ./document.pdf --checksumdispenser -p ./downloads -s se -d 1This creates subdirectories based on file extensions and moves files accordingly.
dispenser -p ./file1.txt,./file2.pdf,./folder1 -mdispenser -p ./documents -s sdm -d 1Creates date-based folders (YYYY-MM-DD) and organizes files by modification date.
dispenser -p ./folder -m -d 3 --checksumDisplays metadata for all items up to 3 levels deep AND calculates checksums for all files.
dispenser/
├── src/
│ ├── main.rs # Entry point and CLI argument parsing
│ ├── display_props.rs # Functions for displaying file/directory properties
│ ├── path_error_handler.rs # Path validation and error handling utilities
│ ├── sorter.rs # File sorting logic
│ └── properties/
│ ├── mod.rs # Module declarations and AccessMethods enum
│ ├── traits.rs # Common traits (Info, Dates, Permission, etc.)
│ ├── file_props.rs # FileProperties struct and implementations
│ └── dir_props.rs # DirectoryProperties struct and implementations
├── Cargo.toml # Project dependencies and metadata
└── README.md # This file
cargo testcargo fmtcargo clippycargo buildcargo run -- -p ./example -m- clap (v4.5.49) - Command-line argument parsing with derive macros
- chrono (v0.4.42) - Date and time handling
- faccess (v0.2.4) - Cross-platform file permission checks
- sha256 (v1.6.0) - SHA-256 hashing
- tempfile (v3.24.0) - Temporary file creation (dev dependency)
- File Organization: Automatically sort messy downloads folders by file type or date
- System Auditing: Generate metadata reports for compliance and documentation
- Data Integrity: Verify file checksums for backup and transfer validation
- Disk Analysis: Analyze directory structures and file distributions
- Automation: Integrate into shell scripts for automated file management workflows
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Param Jasani
- GitHub: @param-jasani
- LinkedIn: param-jasani
- Linktree: ParamJasani
- Built with ❤️ using Rust
- ASCII art generated for project branding
- Inspired by the need for a simple yet powerful file management tool
Dispenser is built with performance in mind:
- Fast: Rust's zero-cost abstractions ensure minimal overhead
- Memory Safe: No buffer overflows or memory leaks
- Concurrent: Efficient processing of large directory structures
- Cross-platform: Works on Windows, macOS, and Linux
None at the moment! If you find a bug, please open an issue.
- Support for more hash algorithms (MD5, SHA-512)
- Parallel file processing for improved performance
- Export metadata to JSON/CSV formats
- File filtering based on size, date ranges, or patterns
- Interactive TUI mode
- Configuration file support
If you find this project useful, please consider giving it a ⭐!
Made with 🦀 Rust