Jeremy Heiler wrote: > On Jun 1, 10:06 pm, Jer <jeremyhei... / gmail.com> wrote: >> > > that all the images are all in the same folder. >> >> > > end >> images. Therefore you don't need to take them and put them into >> another array. Your script can be chomped down to three lines of code >> (including the require) or four if you use do..end instead of { and }. >> >> require 'fileutils' >> Dir.chdir('/Users/jeremy/Desktop/photos') >> Dir.glob("*.{jpg,gif}").each { |pic| FileUtils.mv(pic, "/Users/jeremy/ >> Desktop") } >> >> Look through your code an compare it to mine. Do you see the >> differences? > > Okay, I feel like a doofus. My script only works for one directory. I > didn't re-read you entire message. My fault. thanks for the idea. I knew the glob returned an array, I was thinking I might have to do some recursion so I stored that into the variable. Seems easy enough to move the files from a single directory to a single directory, but I need to move multiple files from multiple directories into a single directory, mainly it is on my server from current/public/images/event (where event is i.e. celine dion or blue man group etc..) to shared/public/images -- Posted via http://www.ruby-forum.com/.