case a [ 0 ] ; when "ls" then ftp. nlst ( ) . each { | file | puts file } ; when "end" then done= true ; when "cd" then ftp. chdir ( a [ 1 ] ) ; when "get" then ftp. getbinaryfile ( a [ 1 ] ) ; when "send" then ftp. putbinaryfile ( a [ 1 ] ) ; else ; puts "command not recognised."