Library to split a large file into small ones, and join them again to the original large file
This library is based in other code [FileUtilities] that I wrote some years ago. The motivation to do this, is to resolve an issue found in the original code and do the library simpler
Note: The original files in the split or join actions, are deleted by default. If you don't want to delete the original file or the cutter files, you should indicate this in the parameters of the Splitter and Joiner methods.
Using the Splitter method
Splitter(string inputFile, int chunkFiles, SizeType sizeType = SizeType.None, bool deleteOriginFile = true)
- This code show you how to split a large file into files of 4 Megabytes:
var fileCutterProcess = new FileCutter.Process();
fileCutterProcess.Splitter(@"C:\Temp\BigFile.txt", 4, SizeType.MBytes);
- This code show you how to split a large file into 5 files:
var fileCutterProcess = new FileCutter.Process();
fileCutterProcess.Splitter(@"C:\Temp\BigFile.txt", 5);
Using the Joiner method
Joiner(string outputPath, bool deleteCutterFiles = true)
- This code show you how to join the splitted files, to the original file:
var fileCutterProcess = new FileCutter.Process();
fileCutterProcess.Joiner(@"C:\Temp");
Note: the join action look for files with the .cut extension.