Boost logo

Boost :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2008-05-22 03:01:20

Vladimir Prus wrote:
> Frank Mori Hess wrote:
>> Hash: SHA1


> Unless you want 'leaf' to be named 'basename'. See, we already have
> 'basename', which unfortunately does something different.

[sorry for jumping in]

I personally have no problems with leaf, but just for comparison, the
following is from Ruby (note that extension can be conditionally removed):

>ri File.basename
--------------------------------------------------------- File::basename
     File.basename(file_name [, suffix] ) -> base_name
     Returns the last component of the filename given in _file_name_,
     which must be formed using forward slashes (``+/+'') regardless of
     the separator used on the local file system. If _suffix_ is given
     and present at the end of _file_name_, it is removed.

        File.basename("/home/gumby/work/ruby.rb") #=> "ruby.rb"
        File.basename("/home/gumby/work/ruby.rb", ".rb") #=> "ruby"

>ri Pathname.basename

------------------------------------------------------ Pathname#basename
     See +File.basename+. Returns the last component of the path.

/ Johan

Boost list run by bdawes at, gregod at, cpdaniel at, john at