This is an experimental file organizer written in Go. It sorts files from an input folder into quarterly subfolders within an output folder, based on their last modification times. The program includes support for optional localization (currently English and Spanish) and configurable folder structure preservation.
- Organizes files into subfolders by year and quarter (e.g.,
2024/Q1_JAN-FEB-MAR) - Preserves or flattens the folder structure based on user input
- Localized log messages in English (
en) or Spanish (es) - Automatically generates and appends log files with detailed operation records
- Go (version 1.16 or newer)
-
Clone the repository:
git clone https://github.com/your-username/file-organizer.git cd file-organizer -
Build the executable:
go build -o file-organizer
Run the program with the required and optional arguments:
./file-organizer --input /path/to/input-folder --output /path/to/output-folder --lang en --preserve-structure| Argument | Description | Required | Default |
|---|---|---|---|
--input |
Path to the input folder. | Yes | None |
--output |
Path to the output folder. | No | Same as --input |
--lang |
Language to use for logs and messages (en for English, es for Spanish). |
No | en |
--preserve-structure |
Preserve the subfolder structure of the input folder under the quarterly folders. | No | Disabled |
Organize files from /home/user/photos into quarterly subfolders under /home/user/sorted with Spanish logs and preserving subfolder structures:
./file-organizer --input /home/user/photos --output /home/user/sorted --lang es --preserve-structureThe program generates log files in the output directory, named in the format .organizer_<timestamp>.log. These logs include:
- Input and output folder paths
- Success and error messages for file operations
- Timestamps for operation start and completion
This tool is experimental! Please be aware of the following:
- Backup your files: Always create a backup of your files before using this tool. Moving files may result in unintended consequences if the tool encounters unexpected errors.
- File handling risks: There may be potential issues during file renaming or copying, particularly with permission restrictions or large file volumes.
- Error reporting: While the tool provides extensive logs, not all edge cases may be handled perfectly.
Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue in this repository.
This project is licensed under the MIT License. See the LICENSE file for details.
