10-line Ruby FTP client

An example of why I like Ruby. This could be shortened further.

#!/usr/bin/ruby

require 'net/ftp'

ftp = Net::FTP.new(*ARGV)

while ! ftp.closed? do
    begin
        puts ftp.send(* STDIN.gets.strip.split(/\s+/))
    rescue
        puts "Command failed, oops."
    end
end
November 07, 2006 @ 9:46 PM PST
Cateogory: Programming
Tags: Ruby

Speak your Mind

You can use Markdown in your comment.
Email/URL are optional. Email is only used for Gravatar.

Preview