From: Daniel Berger Date: 2005-08-19T05:56:07+09:00 Subject: Re: File.basename default suffix? Jason Foreman wrote: > On 8/18/05, Daniel Berger wrote: > >>Hi all, >> >>A recent discussion on file renaming made me wonder something about >>File.basename. >> >>Is there any reason that the suffix shouldn't default to ".*" ? >> >>Current behavior: File.basename("foo.rb") # -> "foo.rb" >>Proposed behavior: File.basename("foo.rb") # -> "foo" >> >>The current behavior just seems rather pointless to me. Or is there a >>good reason for not setting the suffix to a default value? >> >>Regards, >> >>Dan >> >> > > > > You'd lose the capability to grab just the filename out of a path then. > > File.basename('/home/users/foo/bar.rb') # => "bar.rb" > > Oh, right. Duh. Thanks. Dan