From: Ian Duggan Date: 2009-06-01T03:35:47+09:00 Subject: [ruby-core:23648] Re: Counterpart to File.extname On Sun, May 31, 2009 at 1:52 AM, Martin DeMello wrote: > File.extname ought to have a complementary method that gets everything > but the extension. Useful for scripts that need to mangle a filename Is this too much? I admit I find all the File.* ugly to type every time I have to do it. It seems verbose. irb --> fn = "/a/b/c/d.e" ==> "/a/b/c/d.e" irb --> File.join(File.dirname(fn), File.basename(fn, File.extname(fn))) ==> "/a/b/c/d" --Ian