From: Robert Klemme Date: 2003-10-03T01:06:55+09:00 Subject: Re: Getting a list of the files in a directory "Jim Freeze" schrieb im Newsbeitrag news:20031002095840.A51014@freeze.org... > On Thursday, 2 October 2003 at 20:25:44 +0900, Robert Klemme wrote: > > > > "Jim Freeze" schrieb im Newsbeitrag > > > > > > The easy way is to use the glogging feature of Dir#[]. > > > For example > > > > > > files = Dir["*"] > > > > > > To upcase all files in a directory, do: > > > > > > Dir["*"].each { |file| `mv #{file} #{file.upcase}` } > > > > > > for unix. It's similar for windows, but I don't have > > > a windows box to test it. > > > > Why not > > > > Dir["*"].each { |file| File.rename( file, file.upcase ) } > > > > That works to. :) :-))) .... and it's portable! robert