From: Simeon Willbanks Date: 2009-12-23T08:13:21+09:00 Subject: Re: Newbie - Moving Contents From Folder to Another Stefano, Thanks for the suggestion. I implemented a program with your idea. Hope it helps Wood :) Thanks, Simeon #!/usr/bin/env ruby require 'fileutils.rb' class SimpleMover include FileUtils def initialize if ARGV.empty? puts "Source and Destination arguments required:\n"+ "$ ruby SimpleMover.rb ~/Downloads/ ~/Music/" else @source = ARGV[0] @destination = ARGV[1] self.run end end def run mp3s = Dir.glob(@source+"*.mp3"); if mp3s.empty? puts "No mp3s to move." else puts "Moving these mp3s:\n"+mp3s.join("\n") FileUtils.mv mp3s, @destination end end end sm = SimpleMover.new -- Posted via http://www.ruby-forum.com/.