From: "Berger, Daniel" Date: 2006-04-13T04:28:50+09:00 Subject: Re: File basenames using File.basename . . . > -----Original Message----- > From: list-bounce@example.com > [mailto:list-bounce@example.com] On Behalf Of Peter Bailey > Sent: Wednesday, April 12, 2006 1:26 PM > To: ruby-talk ML > Subject: File basenames using File.basename . . . > > > I need to truncate the extension of some of my files, so that > I can add > a different extension for a separate write file. I've tried this: > > txtfiles = Dir.glob("*.txt") > txtfiles.each { |txtfile| File.basename("txtfile", "*.txt") } Remove the quotes around txtfile. Change "*.txt" to just ".txt". Regards, Dan