This always throws me. I keep getting "permission denied" messages when
I simply try to rename files. Here's my code. The files in the directory
start out without an extension.

Dir.chdir("F:/images")
Dir.glob("*").each do |file|
  File.new(file, "r").gets
  if $_ =~ /%!PS-Adobe/
    newfile = file + ".eps"
    File.rename(file, newfile)
  end
end

Thanks,
Peter
-- 
Posted via http://www.ruby-forum.com/.