Jacob Fugal wrote: > On 6/22/06, Peter Bailey <pbailey / bna.com> wrote: >> It says: >> "...can't convert nil into String (Type error)..." > > I think you're mistaking the source of your error here. Check this out > (ri String#downcase!): > > Downcases the contents of _str_, returning +nil+ if no changes were > made. > > So you're call to +downcase!+ is returning nil in the cases where > +file+ was already downcased. When +File.rename+ sees that nil and > tries to convert it to a String, it raises the error you see. > > Try using +String#downcase+ instead (note the lack of the exclamation > point). > > Jacob Fugal I see. Thanks a lot, Jacob. There's danger in my scripting there. I'll try it without the exclamation. -Peter -- Posted via http://www.ruby-forum.com/.