From: ChrisH Date: 2007-08-01T21:59:59+09:00 Subject: Re: Why aren't filenames being lowercased? See inline comments On Aug 1, 8:25 am, Peter Bailey wrote: ... > Dir.chdir("L:/tiff/cdtiff/00000") > Dir.glob("*.tif").each do |tiffile| >From the docs look like it creates an array of matched filke names then iterates, placing current filename in tiffile... > File.rename(tiffile, tiffile.downcase) Rename the file to be lowercase, value in tiffile(and in the array created by Dir.glob) is unchanged... > pdffile = File.basename(tiffile, ".tif") + ".pdf" I think base name is case sensitive, so ".tif" does not match '.TIF' so .pdf is appended instead of replacing '.TIF' > puts "#{tiffile} #{pdffile}" > end > When you go look at the directory the files are in lowercase because your script has made them so. Have you tried re-running on the dir of lower-case names? Cheers Chris