From: Matthew Margolis Date: 2004-08-05T11:06:38+09:00 Subject: Re: open files in other directories WATANABE Hirofumi wrote: >Hi, > >"Mehr, Assaph (Assaph)" writes: > > > >>You're probably trying to remove the extension. Take a look at File >>class methods: basename, extname, dirname etc. You can strip extension >>by: >> base_name = textfilename.delete File.extname(textfilename) >> >> > >% irb > > >>>textfilename = "foo.obj" >>> >>> >=> "foo.obj" > > >>>textfilename.delete File.extname(textfilename) >>> >>> >=> "f" > > >>>File.basename(textfilename, ".*") >>> >>> >=> "foo" > > > I ended up going with File.basename(textfilename, ".txt") That left me with just the pre-extension part of the file name. -Matthew Margolis