Boost logo

Boost Users :

From: Stuart Bingė (omicron-list_at_[hidden])
Date: 2004-06-16 11:28:02

Hello all,

I've recently started using some of the Boost libraries, one of which being
boost::filesystem. I have however encountered a problem while using the
library, which as far as I can tell is a bug. I'm not sure if anyone is aware
of this problem, or if is not an issue with the library itself but rather
with my configuration - in either case a description of the problem follows:

Whenever I instantiate a boost::filesystem::path object and try to print out a
text representation of the path using a method such as .string(), the path
itself is printed out, however it looks as though the string is not
terminated properly as a whole bunch of trailing garbage appears after the

The following sample program produces the problem for me:

#include <iostream>
#include <boost/filesystem/path.hpp>
int main(int c, char** v) {
  boost::filesystem::path testpath("test/path");
  std::cout << testpath.native_file_string() << std::endl;
  return 0;

When I run this code I get output similar to the following:

test/pathp’’’’test/’’’’data’’’’path... etc (a whole bunch of other random
stuff like days of the week & month, as well as garbage character strings)

Can anyone shed some light on this for me? I'm running boost version 1.31.0 on
Gentoo Linux x86 (kernel 2.6.5-gentoo-r1) with GCC version 3.3.2, for anyone
who is interested.

Stuart Bingė

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at