A cool use of Ruby scripting is to split a large file into several smaller, symmetric files. I wrote this script for a friend who was having trouble sending files into and out of his corporate network since the network administrators wouldn't allow files over a certain size to be transferred—presumably for bandwidth reasons. This script worked like a charm.
if ARGV.size != 2 puts "Usage: ruby fileSplit.rb <filename.ext> <size_of_pieces_in_bytes>" puts "Example: ruby fileSplit.rb myfile.txt 10" exit end filename = ARGV size_of_split = ARGV if File.exists?(filename) file = File.open(filename, ...