From: "F. Senault" Date: 2009-04-02T07:24:39+09:00 Subject: Re: Ruby script to rebuild a directory structure Le Wed, 1 Apr 2009 16:48:24 -0500, Emmek On rails a �crit : > Names of directories like "adam", "alan" are users logins in the > database. I need to transform that structure into something like this: > > /logos/756/jdkajsdns.jpg > /logos/815/skdjaksxa.jpg > etc. /.../ > 2) Is it possible to use script/console in Rails and solve the problem > just inside it? Yeps. Something like (completely untested) : require "fileutils" include FileUtils Users.find(:all).each do |u| mkdir "/logos/#{u.id}" cp_r "/users/#{u.login[0..0]}/#{u.login}/logos/.", "/logos/#{u.id}" end You'll find what you're looking for in the FileUtils module : http://www.ruby-doc.org/stdlib/libdoc/fileutils/rdoc/index.html Fred -- OOS Error...