Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.filesystem] query
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2009-02-02 13:15:40


On Mon, Feb 2, 2009 at 13:05, Sean Farrow <sean.farrow_at_[hidden]> wrote:
> I am using boost.filesystem to hold a path including filename. would the
> function stem() of the path object give me the path excluding the filename?
> If i have:
> c:\program files\boost\welcome.txt
> The output wanted is:
> c:\program files\
> Any help apreciated.
>

path("c:\program files\boost\welcome.txt").parent_path().parent_path()
will give you path("c:\program files")

This table is often the easiest way to find out which function you need:
http://www.boost.org/libs/filesystem/doc/reference.html#Path-decomposition-table


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net