File Joining

File Joining

fileJoin.rb

This script was also written for my friend, knowing he would be pretty upset if he didn't have a way to reconstruct his files. This is a companion script for the file-splitting one, and both scripts can be put together in a wrapper if you prefer. (A wrapper is code that brings both scripts together in one utility.) I separated them here for instructional purposes. This file-joining script will only work for files that were previously split (see "#4 File Splitting" on File Splitting); however, you can adjust it to suit your needs.

The Code

 if ARGV.size != 1 puts "Usage: ruby fileJoin.rb <filename.ext>" puts "Example: ...

Get Wicked Cool Ruby Scripts now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.