Hi --

On Sat, 22 Dec 2001, Joseph McDonald wrote:

>  BAA> am trying to write a script that will read in all the file
> names in dir X
> BAA> and convert the upper case letters to lower case. How can do
>  such thing in

>
> Perhaps better ways, but this works for me:
>
> dir = "."
> Dir.foreach(dir) {|filename|
>   newname = filename.tr('A-Z','a-z')
>   File.rename(filename, newname) if newname != filename
> }

Don't forget String#downcase :-)


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav