From: Peter Bailey Date: 2006-04-13T04:25:38+09:00 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") } which yields this: => ["eula.txt", "libcurl.COPYING.txt", "openssl.LICENSE.txt", "psout2.txt", "run dll32.exe.Z-missing.txt"] Obviously, it didn't strip the extensions. What am I doing wrong? Thanks. -- Posted via http://www.ruby-forum.com/.