A simple C++ utility to split a large file into two parts (optionally to different drives) and merge them back together. Useful for moving large files between drives with limited space.
- Split a file into two parts, saving each part to a specified drive or directory.
- Merge two parts back into a single file.
- Progress display for both splitting and merging.
- Command-line interface with flexible options.
- C++17 compiler
- cxxopts (included header-only)
Use your preferred C++ compiler. Example with g++:
g++ splitter.cpp -I./include -o splittersplitter.exe -s --mainfile=<file> --drive1=<drive> --drive2=<drive> --p1size=<size_in_gb>--mainfile: Path to the file you want to split.--drive1: Drive letter or directory for the first part (e.g.,D).--drive2: (Optional) Drive letter or directory for the second part. If omitted, part2 is saved in the current directory.--p1size: Size of the first part in GB.
Example:
splitter.exe -s --mainfile=bigfile.bin --drive1=D --drive2=E --p1size=3.5splitter.exe -m --file1=<part1_path> --file2=<part2_path>--file1: Path to the first part (output file, will be appended to).--file2: Path to the second part (input file).
Example:
splitter.exe -m --file1=D:/part1.bin --file2=E:/part2.binsplitter.exe --help- The program creates files named
part1.binandpart2.binin the specified directories. - Make sure you have enough free space on the target drives.
- The merge operation appends
part2.bintopart1.bin.
See cxxopts.hpp for third-party license.
Author:
Kaleab Nigusse
Contributions and issues are welcome!