Crates.io | fileorg |
lib.rs | fileorg |
version | 0.2.2 |
source | src |
created_at | 2024-03-25 08:51:36.8501 |
updated_at | 2025-01-24 07:13:13.22482 |
description | A simple File Organizer CLI tool made in rust. |
homepage | |
repository | https://github.com/Infernum1/fileorg |
max_upload_size | |
id | 1185089 |
size | 29,430 |
File Organizer is a command-line utility written in Rust that organizes files in a directory based on their types (extensions) into respective subdirectories. It provides flexibility with options for copying or moving files, handling hidden files, and organizing files without extensions.
You can install the File Organizer directly from crates.io using Cargo:
cargo install fileorg
Alternatively, you can build and install the application from the source code:
Clone the repository:
git clone https://github.com/Infernum1/fileorg
Navigate to the project directory:
cd fileorg
Build the project using Cargo:
cargo build --release
To organize files in a directory, run the following command:
fileorg <directory_path> [OPTIONS]
./target/release/fileorg <directory_path> [OPTIONS]
Option | Description | Default |
---|---|---|
--copy | Copy files instead of moving them | False |
--log_file | Specify the log file path | "file_organizer.log" |
--config | Provide a path to a configuration file (.toml format) |
None |
--help, -h | Print help | - |
--version, -V | Print version | - |
If you are using a config file (--config
flag) in the CLI, all other flags will be ignored. If you would like to only use the --copy
and --log_file
flags individually, then there is no need to create a config file.
The config file only allows more control over handling hidden files and miscellaneous stuff.
You can customize the behavior of the File Organizer by providing a configuration file (e.g., config.toml
). The following fields are supported:
copy
: Set to true
to copy files instead of moving them. Defaults to false.
include_hidden
: Set to true
to include hidden files in the organization. Defaults to false
.
others_directory
: Specify the name of the directory for files without extensions. Defaults to "Others"
.
log_file
: Specify the path to the log file where operations will be recorded. Defaults to "file_organizer.log"
.
copy = true
include_hidden = false
others_directory = "Others"
log_file = "file_organizer.log"
To use a configuration file, create a config.toml
file with the format as suggested above, and feed it to the --config
flag in the CLI.
All operations (e.g., file moves, copies, skips) are logged in the file specified in the configuration.