From: Sebastian Hungerecker Date: 2007-09-27T00:33:39+09:00 Subject: Re: Recursing through directories Gabriel Dragffy wrote: > require 'ftools' > Dir.entries( '/Volumes/' ).each |item| do > File.move( item, item.gsub( /\//, '-' ) ) if File.file? item > end > > The idea is to remove slashes from file names, I can later extend > this to include other characters also. But how the deuce can I make > it go in to each directoy to make sure each file is renamed even many > subdirectories down? Use Dir['/Volumes/**/*'] (or even *-* to only get files with a slash in them) instead of Dir.entries. HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826