Skip to content

.NET Core 5 console tool which can split or merge any files of any size. It can handle huge files (100GB+) with a minimal memory fingerprint because it uses streams and adaptive buffers to read and write to disk, based on the process available memory. The speed will depend on the disk IO.

License

Notifications You must be signed in to change notification settings

erionpc/FileSplitterMerger

Repository files navigation

File Splitter and Merger

.NET Core 5 console tool which can:

  • split any binary file into any number of chunks
  • split any binary file into chunks of any size in bytes
  • merge any files

Operation options:

-s = File split
-m = File merge
-i = Syntax info

Split options:

-f = File path
-d = Destination path
-n = Split in number of chunks
-s = Split in chunks of size in bytes

Merge options:

-p = File parts
-d = Destination file path

Examples:

The first argument must be an operation option. The rest of the arguments can be in any order.

Split a file in chunks of specified size:

FileSplitterMerger -s -f <path to file you want to split> -d <destination folder> -s <chunk size in bytes>

Split a file in number of chunks:

FileSplitterMerger -s -f <path to file you want to split> -d <destination folder> -n <number of chunks>

Merge files:

FileSplitterMerger -m -p <file path 1> <file path 2> <file path 3> -d <destination file path>

Publish

Publish for Linux

The beauty of .NET 5 is it's multi-platform, so you can run this app on Linux by publishing it as follows:
dotnet publish -c release -r ubuntu.16.04-x64 --self-contained --output <destination folder>

Run on Linux:

dotnet FileSplitterMerger.dll <arguments: see examples above for the arguments>

Publish for Windows

dotnet publish -c release -r win-x64 --self-contained --output <destination folder>

Implementation notes

The files aren't loaded in memory but they're read and written using streams and buffers. This means that the memory fingerprint of this application is minimal and it can handle files of any size.
The buffer size used by the streams adapts to the available machine memory for improved performance (e.g. with very large files)
Custom enum description attributes are used for making argument detection and management easier.
Dependency injection is used for the configuration.
Extensive unit tests have been included to ensure the correct behaviour in a variety of scenarios.

Download

You can download this for Windows and Linux from the releases section

About

.NET Core 5 console tool which can split or merge any files of any size. It can handle huge files (100GB+) with a minimal memory fingerprint because it uses streams and adaptive buffers to read and write to disk, based on the process available memory. The speed will depend on the disk IO.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages