From: nobu.nokada@... Date: 2001-12-22T08:47:16+09:00 Subject: [ruby-talk:29270] Re: upper case to lower Hello, At Sat, 22 Dec 2001 08:00:08 +0900, Bashar A. Asad wrote: > am trying to write a script that will read in all the file names in dir X > and convert the upper case letters to lower case. How can do such thing in > ruby? There are some ways. Dir.entries(X).each do |f| (n = f.dup).downcase! and File.rename(File.join(X, f), File.join(X, n)) end Dir.open(X) do |d| d.each do |f| (n = f.dup).downcase! and File.rename(File.join(X, f), File.join(X, n)) end end # differs a bit Dir.glob(File.join(X, "*")) do |f| d, n = File.split(f) n.downcase! and File.rename(f, File.join(d, n)) end Nobu Nakada