I need a small application that can split a file up in to pieces of a given size as well as combine existing pieces back in to a single file.
This application will be run from the command line and does not need any user interface. I will need three versions of this application: one to run on each of Windows, Mac OS X and Linux (CentOS). You should be able to write the application in C (or something else) and compile it for each platform with little change.
To test, I will run the application from the command line on several different files of various size and on each of the three OSs. I will also test error cases such as file not found and file busy. I should be able to combine a file that was split on a different OS without problem.
Writing the application in Java is NOT ok.
## Deliverables
The utility will take four parameters. Parameter 1 will be either "-s" for splitting a file or "-c" for combining files. Parameter 2 will be a path to a file - this will be either the file to be split up or the file to be created when combining pieces. Parameter 3 will be the path to a folder. When splitting a file, this folder will be where to save the file pieces. When combining pieces, this folder will be where to find the pieces. Parameter 3 is only used when splitting files and will be a number, representing the size, in kilobytes, each split piece should be (except for the last piece, which should be whatever is left). When splitting a file, the pieces should be named in the format "[login to view URL], [login to view URL], [login to view URL]".
When complete, the application should write "SUCCESS" to the standard output. If there is an error, an error message should be printed instead such as "file not found", "file locked", or "file in use".
Example 1:
$program -s /Users/name/[login to view URL] /Users/temp 25
...The file "[login to view URL]" should be split in to pieces of 25KB each and the pieces should be saved to the "/Users/temp" folder
Example 2:
$program -c /Documents/[login to view URL] "/temp/file pieces"
...All the file pieces found in "/temp file pieces" should be combined and saved as "[login to view URL]"