|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-08-06 10:32:09
I think this is a badly-chosen name. Both POSIX and Python have a
basename function which does roughly what our leaf() function does.
Python:
>>> import os.path
>>> help(os.path.basename)
Help on function basename:
basename(p)
Returns the final component of a pathname
>>> os.path.basename('foo/bar.baz')
'bar.baz'
POSIX:
$ info basename
`basename': Strip directory and suffix from a file name
=======================================================
`basename' removes any leading directory components from NAME.
Synopsis:
basename NAME [SUFFIX]
If SUFFIX is specified and is identical to the end of NAME, it is
removed from NAME as well. `basename' prints the result on standard
output.
$ basename 'foo/bar.baz'
bar.baz
$ basename 'foo/bar.baz' .baz
bar
I don't think we should use creative naming in cases like this one.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk