Boost logo

Boost :

Subject: Re: [boost] Boost.Filesystem: basename function is not compatible with POSIX; potential for path-related security issues
From: Beman Dawes (bdawes_at_[hidden])
Date: 2010-01-17 19:17:06

On Sat, Jan 16, 2010 at 8:45 PM, Steve M. Robbins <steve_at_[hidden]> wrote:

> Hi,
> I got the following report [1] for Boost.Filesystem from a Debian
> user. Before entering into trac, I thought I'd ask whether this
> deviation from POSIX is by design or is a bug.
> Thanks,
> -Steve
> P.S. The original report is based on Boost 1.40, but I
> verified the same behaviour on Boost 1.41.
> [1]
> ----- Forwarded message from Roger Leigh <rleigh_at_[hidden]> -----
> Package: libboost-filesystem1.40.0
> Version: 1.40.0-5
> Severity: important
> The basename function is not compatible with the POSIX function by the
> same name...

Right. That's part of the reason why boost::filesystem::basename() is

Use path::filename() if you want the POSIX functionality. Use path::stem()
if you want the old boost::filesystem::basename() functionality. Use
path::extension() if you want the extension.


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